generated from Legacy-Fabric/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.3.2-forge' into 1.4-forge
# Conflicts: # build.gradle # src/main/java/cpw/mods/fml/relauncher/FMLRelauncher.java # src/main/java/fr/catcore/fabricatedforge/mixin/forgefml/nbt/Client_NbtIoMixin.java
- Loading branch information
Showing
15 changed files
with
288 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/fr/catcore/fabricatedforge/FabricatedForge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package fr.catcore.fabricatedforge; | ||
|
||
import cpw.mods.fml.relauncher.FMLRelauncher; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; | ||
|
||
public class FabricatedForge implements PreLaunchEntrypoint { | ||
@Override | ||
public void onPreLaunch() { | ||
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) FMLRelauncher.preLaunchClientEntry(); | ||
else FMLRelauncher.handleServerPreLaunch(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/main/java/fr/catcore/fabricatedforge/mixin/forgefml/nbt/Server_NbtIoMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package fr.catcore.fabricatedforge.mixin.forgefml.nbt; | ||
|
||
import fr.catcore.cursedmixinextensions.annotations.Public; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.nbt.NbtCompound; | ||
import net.minecraft.nbt.NbtIo; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.io.*; | ||
|
||
@Environment(EnvType.SERVER) | ||
@Mixin(NbtIo.class) | ||
public abstract class Server_NbtIoMixin { | ||
|
||
@Shadow | ||
public static void method_1345(NbtCompound nbtCompound, DataOutput dataOutput) { | ||
} | ||
|
||
@Shadow | ||
public static NbtCompound read(DataInput input) { | ||
return null; | ||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Public | ||
private static void method_1352(NbtCompound par0NBTTagCompound, File par1File) throws IOException { | ||
DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File)); | ||
|
||
try { | ||
method_1345(par0NBTTagCompound, var2); | ||
} finally { | ||
var2.close(); | ||
} | ||
|
||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Public | ||
private static NbtCompound method_1349(File par0File) throws IOException { | ||
if (!par0File.exists()) { | ||
return null; | ||
} else { | ||
DataInputStream var1 = new DataInputStream(new FileInputStream(par0File)); | ||
|
||
NbtCompound var2; | ||
try { | ||
var2 = read(var1); | ||
} finally { | ||
var1.close(); | ||
} | ||
|
||
return var2; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/fr/catcore/fabricatedforge/mixin/forgefml/util/Server_LanguageMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package fr.catcore.fabricatedforge.mixin.forgefml.util; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.util.Language; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Environment(EnvType.SERVER) | ||
@Mixin(Language.class) | ||
public class Server_LanguageMixin { | ||
@Shadow | ||
public String code; | ||
|
||
public String method_636() { | ||
return this.code; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
src/main/java/fr/catcore/fabricatedforge/mixin/forgefml/world/Client_WorldMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package fr.catcore.fabricatedforge.mixin.forgefml.world; | ||
|
||
import fr.catcore.fabricatedforge.mixininterface.IBlock; | ||
import fr.catcore.fabricatedforge.mixininterface.IWorld; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.dimension.Dimension; | ||
import net.minecraftforge.common.ForgeDirection; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Mixin(World.class) | ||
public abstract class Client_WorldMixin implements IWorld { | ||
|
||
@Shadow @Final public Dimension dimension; | ||
|
||
@Shadow public abstract int getBlock(int x, int y, int z); | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Overwrite | ||
public Biome getBiome(int par1, int par2) { | ||
return this.dimension.getBiomeGenForCoords(par1, par2); | ||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Overwrite | ||
public boolean isAir(int par1, int par2, int par3) { | ||
int id = this.getBlock(par1, par2, par3); | ||
return id == 0 || Block.BLOCKS[id] == null || ((IBlock)Block.BLOCKS[id]).isAirBlock((World)(Object) this, par1, par2, par3); | ||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Overwrite | ||
public boolean isBlockSolid(int par1, int par2, int par3) { | ||
Block block = Block.BLOCKS[this.getBlock(par1, par2, par3)]; | ||
return block != null && ((IBlock)block).isBlockNormalCube((World)(Object) this, par1, par2, par3); | ||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Overwrite | ||
public boolean isTopSolid(int par1, int par2, int par3) { | ||
return this.isBlockSolidOnSide(par1, par2, par3, ForgeDirection.UP); | ||
} | ||
|
||
/** | ||
* @author Minecraft Forge | ||
* @reason none | ||
*/ | ||
@Overwrite | ||
public int getMaxBuildHeight() { | ||
return this.dimension.getHeight(); | ||
} | ||
} |
Oops, something went wrong.