Skip to content

Commit

Permalink
remove search block and crafting block
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Jan 2, 2025
1 parent a4474c9 commit 80ab623
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 91 deletions.
11 changes: 0 additions & 11 deletions src/main/java/com/zerofall/ezstorage/block/BlockCraftingBox.java

This file was deleted.

10 changes: 0 additions & 10 deletions src/main/java/com/zerofall/ezstorage/block/BlockSearchBox.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.world.World;

import com.zerofall.ezstorage.EZStorage;
import com.zerofall.ezstorage.configuration.EZConfiguration;
import com.zerofall.ezstorage.tileentity.TileEntityStorageCore;

public class BlockStorageCore extends EZBlockContainer {
Expand All @@ -34,13 +33,7 @@ public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, in
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX,
float subY, float subZ) {
if (!worldIn.isRemote) {
TileEntityStorageCore tileEntity = (TileEntityStorageCore) worldIn.getTileEntity(x, y, z);
if (tileEntity.hasCraftBox || !EZConfiguration.enableSearchBlock) {
player.openGui(EZStorage.instance, 2, worldIn, x, y, z);
} else {
player.openGui(EZStorage.instance, 1, worldIn, x, y, z);
}

player.openGui(EZStorage.instance, 2, worldIn, x, y, z);
}
return true;
}
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/com/zerofall/ezstorage/gui/GuiStorageCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, i
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
this.searchField.setVisible(this.tileEntity.hasSearchBox);
if (this.tileEntity.hasSearchBox) {
this.mc.renderEngine.bindTexture(searchBar);
drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 4, 80, 4, 90, 12);
this.searchField.drawTextBox();
}
this.searchField.setVisible(true);
this.mc.renderEngine.bindTexture(searchBar);
drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 4, 80, 4, 90, 12);
this.searchField.drawTextBox();
}

@Override
Expand Down Expand Up @@ -184,8 +182,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
@Override
protected void keyTyped(char typedChar, int keyCode) {
if (!this.checkHotbarKeys(keyCode)) {
if (this.tileEntity.hasSearchBox && this.searchField.isFocused()
&& this.searchField.textboxKeyTyped(typedChar, keyCode)) {
if (this.searchField.isFocused() && this.searchField.textboxKeyTyped(typedChar, keyCode)) {
updateFilteredItems();
} else {
super.keyTyped(typedChar, keyCode);
Expand Down
40 changes: 0 additions & 40 deletions src/main/java/com/zerofall/ezstorage/init/EZBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

import com.zerofall.ezstorage.Reference;
import com.zerofall.ezstorage.block.BlockCondensedStorage;
import com.zerofall.ezstorage.block.BlockCraftingBox;
import com.zerofall.ezstorage.block.BlockHyperStorage;
import com.zerofall.ezstorage.block.BlockInputPort;
import com.zerofall.ezstorage.block.BlockOutputPort;
import com.zerofall.ezstorage.block.BlockSearchBox;
import com.zerofall.ezstorage.block.BlockStorage;
import com.zerofall.ezstorage.block.BlockStorageCore;
import com.zerofall.ezstorage.tileentity.TileEntityInputPort;
Expand All @@ -32,8 +30,6 @@ public class EZBlocks {
public static Block hyper_storage_box;
public static Block input_port;
public static Block output_port;
public static Block crafting_box;
public static Block search_box;

public static final Logger LOG = LogManager.getLogger(Reference.MOD_ID);

Expand All @@ -44,8 +40,6 @@ public static void init() {
hyper_storage_box = new BlockHyperStorage();
input_port = new BlockInputPort();
output_port = new BlockOutputPort();
crafting_box = new BlockCraftingBox();
search_box = new BlockSearchBox();
}

public static void register() {
Expand Down Expand Up @@ -76,14 +70,6 @@ public static void register() {
output_port.getUnlocalizedName()
.substring(5));
GameRegistry.registerTileEntity(TileEntityOutputPort.class, "TileEntityOutputPort");
GameRegistry.registerBlock(
crafting_box,
crafting_box.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(
search_box,
search_box.getUnlocalizedName()
.substring(5));
registerRecipes();
}

Expand All @@ -94,8 +80,6 @@ public static void registerRenders() {
registerRender(hyper_storage_box);
registerRender(input_port);
registerRender(output_port);
registerRender(crafting_box);
registerRender(search_box);
}

public static void registerRender(Block block) {
Expand Down Expand Up @@ -157,29 +141,5 @@ public static void registerRecipes() {
"blockQuartz"));
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(output_port), "A", "B", "A", 'A', Blocks.piston, 'B', input_port));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(crafting_box),
"ABA",
"BCB",
"ABA",
'A',
Items.ender_eye,
'B',
Blocks.crafting_table,
'C',
"gemDiamond"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(search_box),
"ABA",
"BCB",
"ABA",
'A',
"blockIron",
'B',
Items.enchanted_book,
'C',
Items.compass));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;

import com.zerofall.ezstorage.block.BlockCraftingBox;
import com.zerofall.ezstorage.block.BlockInputPort;
import com.zerofall.ezstorage.block.BlockOutputPort;
import com.zerofall.ezstorage.block.BlockSearchBox;
import com.zerofall.ezstorage.block.BlockStorage;
import com.zerofall.ezstorage.block.BlockStorageCore;
import com.zerofall.ezstorage.block.StorageMultiblock;
Expand All @@ -37,8 +35,6 @@ public class TileEntityStorageCore extends TileEntity implements IUpdatePlayerLi

Set<BlockRef> multiblock = new HashSet<BlockRef>();
private boolean firstTick = false;
public boolean hasCraftBox = false;
public boolean hasSearchBox = false;
public boolean disabled = false;

public TileEntityStorageCore() {
Expand Down Expand Up @@ -97,7 +93,6 @@ public void writeToNBT(NBTTagCompound paramNBTTagCompound) {
}
paramNBTTagCompound.setTag("Internal", nbttaglist);
paramNBTTagCompound.setLong("InternalMax", this.inventory.maxItems);
paramNBTTagCompound.setBoolean("hasSearchBox", this.hasSearchBox);
paramNBTTagCompound.setBoolean("isDisabled", this.disabled);
}

Expand All @@ -118,7 +113,6 @@ public void readFromNBT(NBTTagCompound paramNBTTagCompound) {
}
long maxItems = paramNBTTagCompound.getLong("InternalMax");
this.inventory.maxItems = maxItems;
this.hasSearchBox = paramNBTTagCompound.getBoolean("hasSearchBox");
this.disabled = paramNBTTagCompound.getBoolean("isDisabled");
}

Expand All @@ -127,8 +121,6 @@ public void readFromNBT(NBTTagCompound paramNBTTagCompound) {
*/
public void scanMultiblock(EntityLivingBase entity) {
inventory.maxItems = 0;
this.hasCraftBox = false;
this.hasSearchBox = false;
multiblock = new HashSet<BlockRef>();
BlockRef ref = new BlockRef(this);
multiblock.add(ref);
Expand Down Expand Up @@ -164,12 +156,6 @@ private void getValidNeighbors(BlockRef br, EntityLivingBase entity) {
((TileEntityOutputPort) te).core = this;
}
}
if (blockRef.block instanceof BlockCraftingBox) {
this.hasCraftBox = true;
}
if (blockRef.block instanceof BlockSearchBox) {
this.hasSearchBox = true;
}
getValidNeighbors(blockRef, entity);
}
}
Expand Down

0 comments on commit 80ab623

Please sign in to comment.