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 remote-tracking branch 'origin/1.4.6-forge' into 1.4.7-forge
# Conflicts: # build.gradle # src/main/resources/fabricated-forge.forge.mixins.json
- Loading branch information
Showing
15 changed files
with
228 additions
and
93 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
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
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(); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/fr/catcore/fabricatedforge/mixin/forgefml/world/Server_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,57 @@ | ||
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.BlockView; | ||
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.SERVER) | ||
@Mixin(World.class) | ||
public abstract class Server_WorldMixin implements BlockView, IWorld { | ||
@Shadow @Final public Dimension dimension; | ||
|
||
@Override | ||
public Biome getBiome(int par1, int par2) { | ||
return this.dimension.getBiomeGenForCoords(par1, par2); | ||
} | ||
|
||
@Override | ||
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 | ||
*/ | ||
@Override | ||
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 | ||
*/ | ||
@Override | ||
public boolean isTopSolid(int par1, int par2, int par3) { | ||
return this.isBlockSolidOnSide(par1, par2, par3, ForgeDirection.UP); | ||
} | ||
|
||
@Override | ||
public int getMaxBuildHeight() { | ||
return this.dimension.getHeight(); | ||
} | ||
} |
Oops, something went wrong.