Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.5.11:dev")
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.114:dev')
api("com.github.GTNewHorizons:GTNHLib:0.6.40:dev")
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.470:dev')
runtimeOnly("com.github.GTNewHorizons:Mixingasm:v0.2.4:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev")
implementation('com.github.GTNewHorizons:Railcraft:9.15.15:dev')
implementation("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false }
implementation("com.github.GTNewHorizons:EnderIO:2.8.22:dev") { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.91-GTNH:dev")
implementation('com.github.GTNewHorizons:Railcraft:9.16.33:dev')
implementation("com.github.GTNewHorizons:EnderCore:0.4.8:dev") { transitive = false }
implementation("com.github.GTNewHorizons:EnderIO:2.9.26:dev") { transitive = false }
implementation('com.github.GTNewHorizons:twilightforest:2.6.5:dev')
implementation("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.97-GTNH:dev")
implementation("com.github.GTNewHorizons:Galacticraft:3.2.6-GTNH:dev")
implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.16-GTNH:dev")
implementation("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.121-GTNH:dev")
implementation("com.github.GTNewHorizons:Galacticraft:3.3.12-GTNH:dev")
implementation("com.github.GTNewHorizons:TinkersConstruct:1.13.54-GTNH:dev")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizons.modularui.api.screen.ModularWindow;
Expand All @@ -29,6 +30,9 @@ public ETHPrimitiveHatchInput(int aID, int aSlot, String aName, String aNameRegi
AuthorEasyTechForItem });
}

private int texturePage = 0;
private int textureIndex = 0;

public ETHPrimitiveHatchInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
Expand All @@ -41,13 +45,10 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing,
int colorIndex, boolean aActive, boolean redstoneLevel) {
int texturePointer = getUpdateData(); // just to be sure, from my testing the 8th bit cannot be
// set clientside
int textureIndex = texturePointer | (getmTexturePage() << 7); // Shift seven since one page is 128 textures!

ITexture background;
if (textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[getmTexturePage()][texturePointer];
if (texturePage > 0 || textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[texturePage][textureIndex];
} else {
background = TextureFactory.of(Blocks.stonebrick);
}
Expand Down Expand Up @@ -84,4 +85,27 @@ public int getCapacity() {
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
super.addUIWidgets(builder, buildContext);
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
texturePage = aNBT.getInteger("texturePage");
textureIndex = aNBT.getInteger("textureIndex");

myupdateTexture(texturePage << 7 | textureIndex);
}

@Override
public void onDescriptionPacket(NBTTagCompound data) {
super.onDescriptionPacket(data);
texturePage = data.getInteger("texturePage");
textureIndex = data.getInteger("textureIndex");
}

public final void myupdateTexture(int id) {
texturePage = id >> 7;
textureIndex = id & 127;

updateTexture(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static com.hepdd.easytech.loaders.preload.ETHStatics.AuthorEasyTechForItem;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizons.modularui.api.screen.ModularWindow;
Expand All @@ -29,6 +29,9 @@ public ETHPrimitiveHatchInputBus(int id, String name, String nameRegional, int t
new String[] { "Item Input for Multiblocks", "Capacity: 1 stack", AuthorEasyTechForItem });
}

private int texturePage = 0;
private int textureIndex = 0;

public ETHPrimitiveHatchInputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
Expand All @@ -41,13 +44,10 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing,
int colorIndex, boolean aActive, boolean redstoneLevel) {
int texturePointer = getUpdateData(); // just to be sure, from my testing the 8th bit cannot be
// set clientside
int textureIndex = texturePointer | (getmTexturePage() << 7); // Shift seven since one page is 128 textures!

ITexture background;
if (textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[getmTexturePage()][texturePointer];
if (texturePage > 0 || textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[texturePage][textureIndex];
} else {
background = TextureFactory.of(Blocks.stonebrick);
}
Expand Down Expand Up @@ -76,9 +76,6 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex
&& (disableLimited || limitedAllowPutStack(aIndex, aStack));
}

@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {}

@Override
public boolean allowSelectCircuit() {
return false;
Expand All @@ -88,4 +85,27 @@ public boolean allowSelectCircuit() {
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
getBaseMetaTileEntity().add1by1Slot(builder);
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
texturePage = aNBT.getInteger("texturePage");
textureIndex = aNBT.getInteger("textureIndex");

myupdateTexture(texturePage << 7 | textureIndex);
}

@Override
public void onDescriptionPacket(NBTTagCompound data) {
super.onDescriptionPacket(data);
texturePage = data.getInteger("texturePage");
textureIndex = data.getInteger("textureIndex");
}

public final void myupdateTexture(int id) {
texturePage = id >> 7;
textureIndex = id & 127;

updateTexture(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static com.hepdd.easytech.loaders.preload.ETHStatics.AuthorEasyTechForItem;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizons.modularui.api.screen.ModularWindow;
Expand Down Expand Up @@ -33,6 +33,9 @@ public ETHPrimitiveHatchOutput(int aID, String aName, String aNameRegional, int
1);
}

private int texturePage = 0;
private int textureIndex = 0;

public ETHPrimitiveHatchOutput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
Expand All @@ -57,19 +60,13 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {}

@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {}

@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing,
int colorIndex, boolean aActive, boolean redstoneLevel) {
int texturePointer = getUpdateData(); // just to be sure, from my testing the 8th bit cannot be
// set clientside
int textureIndex = texturePointer | (getmTexturePage() << 7); // Shift seven since one page is 128 textures!

ITexture background;
if (textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[getmTexturePage()][texturePointer];
if (texturePage > 0 || textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[texturePage][textureIndex];
} else {
background = TextureFactory.of(Blocks.stonebrick);
}
Expand Down Expand Up @@ -119,4 +116,27 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setPos(10, 30));
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
texturePage = aNBT.getInteger("texturePage");
textureIndex = aNBT.getInteger("textureIndex");

myupdateTexture(texturePage << 7 | textureIndex);
}

@Override
public void onDescriptionPacket(NBTTagCompound data) {
super.onDescriptionPacket(data);
texturePage = data.getInteger("texturePage");
textureIndex = data.getInteger("textureIndex");
}

public final void myupdateTexture(int id) {
texturePage = id >> 7;
textureIndex = id & 127;

updateTexture(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizons.modularui.api.screen.ModularWindow;
Expand All @@ -28,6 +29,9 @@ public ETHPrimitiveHatchOutputBus(int aID, String aName, String aNameRegional, i
1);
}

private int texturePage = 0;
private int textureIndex = 0;

public ETHPrimitiveHatchOutputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
Expand All @@ -40,13 +44,10 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing,
int colorIndex, boolean aActive, boolean redstoneLevel) {
int texturePointer = getUpdateData(); // just to be sure, from my testing the 8th bit cannot be
// set clientside
int textureIndex = texturePointer | (getmTexturePage() << 7); // Shift seven since one page is 128 textures!

ITexture background;
if (textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[getmTexturePage()][texturePointer];
if (texturePage > 0 || textureIndex > 0) {
background = Textures.BlockIcons.casingTexturePages[texturePage][textureIndex];
} else {
background = TextureFactory.of(Blocks.stonebrick);
}
Expand Down Expand Up @@ -75,4 +76,27 @@ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aInde
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
getBaseMetaTileEntity().add1by1Slot(builder);
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
texturePage = aNBT.getInteger("texturePage");
textureIndex = aNBT.getInteger("textureIndex");

myupdateTexture(texturePage << 7 | textureIndex);
}

@Override
public void onDescriptionPacket(NBTTagCompound data) {
super.onDescriptionPacket(data);
texturePage = data.getInteger("texturePage");
textureIndex = data.getInteger("textureIndex");
}

public final void myupdateTexture(int id) {
texturePage = id >> 7;
textureIndex = id & 127;

updateTexture(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.stream.Collectors;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -329,11 +328,6 @@ public int getDamageToComponent(ItemStack aStack) {
return 0;
}

@Override
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}

@Override
public ChunkCoordIntPair getActiveChunk() {
return mCurrentChunk;
Expand All @@ -347,11 +341,11 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
if (mMachine) return -1;
return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true);
return survivalBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true);
}

@Override
protected boolean showRecipeTextInGUI() {
public boolean showRecipeTextInGUI() {
return false;
}

Expand Down Expand Up @@ -564,12 +558,6 @@ protected List<IHatchElement<? super ETHVoidMinerBase>> getAllowedHatches() {
return ImmutableList.of(InputBus, OutputBus, Maintenance, Energy);
}

@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {
this.mBlacklist = !this.mBlacklist;
GTUtility.sendChatToPlayer(aPlayer, "Mode: " + (this.mBlacklist ? "Blacklist" : "Whitelist"));
}

@Override
protected MultiblockTooltipBuilder createTooltip() {
String casings = this.getCasingBlockItem()
Expand Down
17 changes: 7 additions & 10 deletions src/main/java/com/hepdd/easytech/api/objects/GTChunkManagerEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GTChunkManagerEx
public static GTChunkManagerEx instance = new GTChunkManagerEx();

public static void init() {
ForgeChunkManager.setForcedChunkLoadingCallback(GTMod.instance, instance);
ForgeChunkManager.setForcedChunkLoadingCallback(GTMod.GT, instance);
}

@Override
Expand Down Expand Up @@ -115,10 +115,10 @@ public static boolean requestPlayerChunkLoad(TileEntity owner, ChunkCoordIntPair
ForgeChunkManager.forceChunk(instance.registeredTickets.get(owner), chunkXZ);
} else {
ForgeChunkManager.Ticket ticket;
if (player.isEmpty()) ticket = ForgeChunkManager
.requestTicket(GTMod.instance, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL);
if (player.isEmpty())
ticket = ForgeChunkManager.requestTicket(GTMod.GT, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL);
else ticket = ForgeChunkManager
.requestPlayerTicket(GTMod.instance, player, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL);
.requestPlayerTicket(GTMod.GT, player, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL);
if (ticket == null) {
if (GTValues.debugChunkloaders)
GTLog.out.println("GTChunkManager: ForgeChunkManager.requestTicket failed");
Expand Down Expand Up @@ -158,12 +158,9 @@ public static boolean requestPlayerChunkLoad(TileEntity owner, ChunkCoordIntPair
} else {
ForgeChunkManager.Ticket ticket;
if (player.isEmpty()) ticket = ForgeChunkManager
.requestTicket(GTMod.instance, DimensionManager.getWorld(dimId), ForgeChunkManager.Type.NORMAL);
else ticket = ForgeChunkManager.requestPlayerTicket(
GTMod.instance,
player,
DimensionManager.getWorld(dimId),
ForgeChunkManager.Type.NORMAL);
.requestTicket(GTMod.GT, DimensionManager.getWorld(dimId), ForgeChunkManager.Type.NORMAL);
else ticket = ForgeChunkManager
.requestPlayerTicket(GTMod.GT, player, DimensionManager.getWorld(dimId), ForgeChunkManager.Type.NORMAL);
if (ticket == null) {
if (GTValues.debugChunkloaders)
GTLog.out.println("GTChunkManager: ForgeChunkManager.requestTicket failed");
Expand Down