mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
this
This commit is contained in:
parent
928676ea53
commit
9ab94e5701
79 changed files with 593 additions and 593 deletions
|
@ -62,10 +62,10 @@ public class EntrySet{
|
||||||
|
|
||||||
public NBTTagCompound writeToNBT(){
|
public NBTTagCompound writeToNBT(){
|
||||||
NBTTagCompound compound = new NBTTagCompound();
|
NBTTagCompound compound = new NBTTagCompound();
|
||||||
compound.setInteger("Entry", entry == null ? -1 : ActuallyAdditionsAPI.bookletEntries.indexOf(entry));
|
compound.setInteger("Entry", this.entry == null ? -1 : ActuallyAdditionsAPI.bookletEntries.indexOf(this.entry));
|
||||||
compound.setInteger("Chapter", entry == null || chapter == null ? -1 : entry.getChapters().indexOf(chapter));
|
compound.setInteger("Chapter", this.entry == null || this.chapter == null ? -1 : this.entry.getChapters().indexOf(this.chapter));
|
||||||
compound.setInteger("Page", page == null ? -1 : page.getID());
|
compound.setInteger("Page", this.page == null ? -1 : this.page.getID());
|
||||||
compound.setInteger("PageInIndex", pageInIndex);
|
compound.setInteger("PageInIndex", this.pageInIndex);
|
||||||
return compound;
|
return compound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class BlockWallAA extends BlockBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(IBlockState state){
|
public int damageDropped(IBlockState state){
|
||||||
return meta;
|
return this.meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -85,10 +85,10 @@ public class BlockPlant extends BlockCrops{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing facing, float hitX, float hitY, float hitZ){
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||||
if(getMetaFromState(state) >= 7){
|
if(this.getMetaFromState(state) >= 7){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
|
||||||
List<ItemStack> drops = getDrops(world, pos, state, 0);
|
List<ItemStack> drops = this.getDrops(world, pos, state, 0);
|
||||||
boolean deductedSeedSize = false;
|
boolean deductedSeedSize = false;
|
||||||
for(ItemStack drop : drops){
|
for(ItemStack drop : drops){
|
||||||
if(drop != null){
|
if(drop != null){
|
||||||
|
@ -104,7 +104,7 @@ public class BlockPlant extends BlockCrops{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
world.setBlockState(pos, getStateFromMeta(0));
|
world.setBlockState(pos, this.getStateFromMeta(0));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class BlockPlant extends BlockCrops{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDropped(IBlockState state, int fortune, Random random){
|
public int quantityDropped(IBlockState state, int fortune, Random random){
|
||||||
return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random);
|
return this.getMetaFromState(state) >= 7 ? random.nextInt(this.addDropAmount)+this.minDropAmount : super.quantityDropped(state, fortune, random);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -321,17 +321,17 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
|
||||||
this.buttonList.add(this.buttonConfig);
|
this.buttonList.add(this.buttonConfig);
|
||||||
|
|
||||||
for(int i = 0; i < this.chapterButtons.length; i++){
|
for(int i = 0; i < this.chapterButtons.length; i++){
|
||||||
this.chapterButtons[i] = new IndexButton(9+i, guiLeft+15, guiTop+10+(i*12), 115, 10, "", this);
|
this.chapterButtons[i] = new IndexButton(9+i, this.guiLeft+15, this.guiTop+10+(i*12), 115, 10, "", this);
|
||||||
this.buttonList.add(this.chapterButtons[i]);
|
this.buttonList.add(this.chapterButtons[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
for(int i = 0; i < this.bookmarkButtons.length; i++){
|
||||||
int x = this.guiLeft+xSize/2-(this.bookmarkButtons.length/2*16)+(i*16);
|
int x = this.guiLeft+this.xSize/2-(this.bookmarkButtons.length/2*16)+(i*16);
|
||||||
this.bookmarkButtons[i] = new BookmarkButton(this.chapterButtons[this.chapterButtons.length-1].id+1+i, x, this.guiTop+this.ySize+13, this);
|
this.bookmarkButtons[i] = new BookmarkButton(this.chapterButtons[this.chapterButtons.length-1].id+1+i, x, this.guiTop+this.ySize+13, this);
|
||||||
this.buttonList.add(this.bookmarkButtons[i]);
|
this.buttonList.add(this.bookmarkButtons[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.searchField = new GuiTextField(4500, this.fontRendererObj, guiLeft+148, guiTop+162, 66, 10);
|
this.searchField = new GuiTextField(4500, this.fontRendererObj, this.guiLeft+148, this.guiTop+162, 66, 10);
|
||||||
this.searchField.setMaxStringLength(30);
|
this.searchField.setMaxStringLength(30);
|
||||||
this.searchField.setEnableBackgroundDrawing(false);
|
this.searchField.setEnableBackgroundDrawing(false);
|
||||||
this.searchField.setCanLoseFocus(false);
|
this.searchField.setCanLoseFocus(false);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class PageCrusherRecipe extends BookletPageAA{
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||||
if(recipe != null){
|
if(this.recipe != null){
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc);
|
Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc);
|
||||||
gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 60, 180, 60, 60);
|
gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 60, 180, 60, 60);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class PageCrusherRecipe extends BookletPageAA{
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
|
||||||
if(recipe == null){
|
if(this.recipe == null){
|
||||||
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false);
|
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -65,12 +65,12 @@ public class PageCrusherRecipe extends BookletPageAA{
|
||||||
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false);
|
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(recipe != null){
|
if(this.recipe != null){
|
||||||
if(recipe.outputTwoChance > 0){
|
if(this.recipe.outputTwoChance > 0){
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0);
|
Minecraft.getMinecraft().fontRendererObj.drawString(this.recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(recipe.getRecipeOutputOnes() != null){
|
if(this.recipe.getRecipeOutputOnes() != null){
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
for(int j = 0; j < 3; j++){
|
for(int j = 0; j < 3; j++){
|
||||||
ItemStack stack;
|
ItemStack stack;
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class PagePicture extends PageTextOnly{
|
||||||
|
|
||||||
String text = gui.getCurrentEntrySet().page.getText();
|
String text = gui.getCurrentEntrySet().page.getText();
|
||||||
if(text != null && !text.isEmpty()){
|
if(text != null && !text.isEmpty()){
|
||||||
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+textStartY, 115, 0, false);
|
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+this.textStartY, 115, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,251 +47,251 @@ public class CreativeTab extends CreativeTabs{
|
||||||
public void displayAllRelevantItems(List<ItemStack> list){
|
public void displayAllRelevantItems(List<ItemStack> list){
|
||||||
this.list = list;
|
this.list = list;
|
||||||
|
|
||||||
add(InitItems.itemBooklet);
|
this.add(InitItems.itemBooklet);
|
||||||
add(InitBlocks.blockSmileyCloud);
|
this.add(InitBlocks.blockSmileyCloud);
|
||||||
|
|
||||||
add(InitBlocks.blockFireworkBox);
|
this.add(InitBlocks.blockFireworkBox);
|
||||||
add(InitBlocks.blockLaserRelay);
|
this.add(InitBlocks.blockLaserRelay);
|
||||||
add(InitBlocks.blockAtomicReconstructor);
|
this.add(InitBlocks.blockAtomicReconstructor);
|
||||||
add(InitBlocks.blockPhantomface);
|
this.add(InitBlocks.blockPhantomface);
|
||||||
add(InitBlocks.blockPhantomEnergyface);
|
this.add(InitBlocks.blockPhantomEnergyface);
|
||||||
add(InitBlocks.blockPhantomLiquiface);
|
this.add(InitBlocks.blockPhantomLiquiface);
|
||||||
add(InitBlocks.blockPhantomPlacer);
|
this.add(InitBlocks.blockPhantomPlacer);
|
||||||
add(InitBlocks.blockPhantomBreaker);
|
this.add(InitBlocks.blockPhantomBreaker);
|
||||||
add(InitBlocks.blockInputter);
|
this.add(InitBlocks.blockInputter);
|
||||||
add(InitBlocks.blockInputterAdvanced);
|
this.add(InitBlocks.blockInputterAdvanced);
|
||||||
add(InitBlocks.blockPhantomBooster);
|
this.add(InitBlocks.blockPhantomBooster);
|
||||||
add(InitBlocks.blockCoffeeMachine);
|
this.add(InitBlocks.blockCoffeeMachine);
|
||||||
add(InitBlocks.blockXPSolidifier);
|
this.add(InitBlocks.blockXPSolidifier);
|
||||||
|
|
||||||
add(InitBlocks.blockMiner);
|
this.add(InitBlocks.blockMiner);
|
||||||
add(InitBlocks.blockGreenhouseGlass);
|
this.add(InitBlocks.blockGreenhouseGlass);
|
||||||
add(InitBlocks.blockGrinder);
|
this.add(InitBlocks.blockGrinder);
|
||||||
add(InitBlocks.blockGrinderDouble);
|
this.add(InitBlocks.blockGrinderDouble);
|
||||||
add(InitBlocks.blockFurnaceDouble);
|
this.add(InitBlocks.blockFurnaceDouble);
|
||||||
add(InitBlocks.blockLavaFactoryController);
|
this.add(InitBlocks.blockLavaFactoryController);
|
||||||
|
|
||||||
add(InitBlocks.blockEnergizer);
|
this.add(InitBlocks.blockEnergizer);
|
||||||
add(InitBlocks.blockEnervator);
|
this.add(InitBlocks.blockEnervator);
|
||||||
|
|
||||||
add(InitBlocks.blockFurnaceSolar);
|
this.add(InitBlocks.blockFurnaceSolar);
|
||||||
add(InitBlocks.blockHeatCollector);
|
this.add(InitBlocks.blockHeatCollector);
|
||||||
add(InitBlocks.blockCoalGenerator);
|
this.add(InitBlocks.blockCoalGenerator);
|
||||||
add(InitBlocks.blockOilGenerator);
|
this.add(InitBlocks.blockOilGenerator);
|
||||||
add(InitBlocks.blockLeafGenerator);
|
this.add(InitBlocks.blockLeafGenerator);
|
||||||
|
|
||||||
add(InitBlocks.blockItemRepairer);
|
this.add(InitBlocks.blockItemRepairer);
|
||||||
add(InitBlocks.blockFishingNet);
|
this.add(InitBlocks.blockFishingNet);
|
||||||
add(InitBlocks.blockBreaker);
|
this.add(InitBlocks.blockBreaker);
|
||||||
add(InitBlocks.blockDirectionalBreaker);
|
this.add(InitBlocks.blockDirectionalBreaker);
|
||||||
add(InitBlocks.blockRangedCollector);
|
this.add(InitBlocks.blockRangedCollector);
|
||||||
add(InitBlocks.blockPlacer);
|
this.add(InitBlocks.blockPlacer);
|
||||||
add(InitBlocks.blockDropper);
|
this.add(InitBlocks.blockDropper);
|
||||||
add(InitBlocks.blockFluidPlacer);
|
this.add(InitBlocks.blockFluidPlacer);
|
||||||
add(InitBlocks.blockFluidCollector);
|
this.add(InitBlocks.blockFluidCollector);
|
||||||
|
|
||||||
add(InitBlocks.blockMisc);
|
this.add(InitBlocks.blockMisc);
|
||||||
add(InitBlocks.blockFeeder);
|
this.add(InitBlocks.blockFeeder);
|
||||||
add(InitBlocks.blockCompost);
|
this.add(InitBlocks.blockCompost);
|
||||||
add(InitBlocks.blockGiantChest);
|
this.add(InitBlocks.blockGiantChest);
|
||||||
add(InitBlocks.blockCanolaPress);
|
this.add(InitBlocks.blockCanolaPress);
|
||||||
add(InitBlocks.blockFermentingBarrel);
|
this.add(InitBlocks.blockFermentingBarrel);
|
||||||
|
|
||||||
add(InitBlocks.blockTestifiBucksGreenWall);
|
this.add(InitBlocks.blockTestifiBucksGreenWall);
|
||||||
add(InitBlocks.blockTestifiBucksWhiteWall);
|
this.add(InitBlocks.blockTestifiBucksWhiteWall);
|
||||||
add(InitBlocks.blockTestifiBucksGreenStairs);
|
this.add(InitBlocks.blockTestifiBucksGreenStairs);
|
||||||
add(InitBlocks.blockTestifiBucksWhiteStairs);
|
this.add(InitBlocks.blockTestifiBucksWhiteStairs);
|
||||||
add(InitBlocks.blockTestifiBucksGreenSlab);
|
this.add(InitBlocks.blockTestifiBucksGreenSlab);
|
||||||
add(InitBlocks.blockTestifiBucksWhiteSlab);
|
this.add(InitBlocks.blockTestifiBucksWhiteSlab);
|
||||||
add(InitBlocks.blockTestifiBucksGreenFence);
|
this.add(InitBlocks.blockTestifiBucksGreenFence);
|
||||||
add(InitBlocks.blockTestifiBucksWhiteFence);
|
this.add(InitBlocks.blockTestifiBucksWhiteFence);
|
||||||
|
|
||||||
add(InitBlocks.blockQuartzWall);
|
this.add(InitBlocks.blockQuartzWall);
|
||||||
add(InitBlocks.blockQuartzStair);
|
this.add(InitBlocks.blockQuartzStair);
|
||||||
add(InitBlocks.blockQuartzSlab);
|
this.add(InitBlocks.blockQuartzSlab);
|
||||||
add(InitBlocks.blockChiseledQuartzWall);
|
this.add(InitBlocks.blockChiseledQuartzWall);
|
||||||
add(InitBlocks.blockChiseledQuartzStair);
|
this.add(InitBlocks.blockChiseledQuartzStair);
|
||||||
add(InitBlocks.blockChiseledQuartzSlab);
|
this.add(InitBlocks.blockChiseledQuartzSlab);
|
||||||
add(InitBlocks.blockPillarQuartzWall);
|
this.add(InitBlocks.blockPillarQuartzWall);
|
||||||
add(InitBlocks.blockPillarQuartzStair);
|
this.add(InitBlocks.blockPillarQuartzStair);
|
||||||
add(InitBlocks.blockPillarQuartzSlab);
|
this.add(InitBlocks.blockPillarQuartzSlab);
|
||||||
|
|
||||||
add(InitBlocks.blockColoredLamp);
|
this.add(InitBlocks.blockColoredLamp);
|
||||||
add(InitBlocks.blockColoredLampOn);
|
this.add(InitBlocks.blockColoredLampOn);
|
||||||
add(InitBlocks.blockLampPowerer);
|
this.add(InitBlocks.blockLampPowerer);
|
||||||
add(InitBlocks.blockTreasureChest);
|
this.add(InitBlocks.blockTreasureChest);
|
||||||
|
|
||||||
add(InitBlocks.blockBlackLotus);
|
this.add(InitBlocks.blockBlackLotus);
|
||||||
|
|
||||||
add(InitItems.itemColorLens);
|
this.add(InitItems.itemColorLens);
|
||||||
add(InitItems.itemExplosionLens);
|
this.add(InitItems.itemExplosionLens);
|
||||||
add(InitItems.itemDamageLens);
|
this.add(InitItems.itemDamageLens);
|
||||||
add(InitItems.itemLaserWrench);
|
this.add(InitItems.itemLaserWrench);
|
||||||
add(InitItems.itemCrateKeeper);
|
this.add(InitItems.itemCrateKeeper);
|
||||||
add(InitItems.itemChestToCrateUpgrade);
|
this.add(InitItems.itemChestToCrateUpgrade);
|
||||||
|
|
||||||
add(InitItems.itemDrill);
|
this.add(InitItems.itemDrill);
|
||||||
add(InitItems.itemDrillUpgradeSpeed);
|
this.add(InitItems.itemDrillUpgradeSpeed);
|
||||||
add(InitItems.itemDrillUpgradeSpeedII);
|
this.add(InitItems.itemDrillUpgradeSpeedII);
|
||||||
add(InitItems.itemDrillUpgradeSpeedIII);
|
this.add(InitItems.itemDrillUpgradeSpeedIII);
|
||||||
add(InitItems.itemDrillUpgradeSilkTouch);
|
this.add(InitItems.itemDrillUpgradeSilkTouch);
|
||||||
add(InitItems.itemDrillUpgradeFortune);
|
this.add(InitItems.itemDrillUpgradeFortune);
|
||||||
add(InitItems.itemDrillUpgradeFortuneII);
|
this.add(InitItems.itemDrillUpgradeFortuneII);
|
||||||
add(InitItems.itemDrillUpgradeThreeByThree);
|
this.add(InitItems.itemDrillUpgradeThreeByThree);
|
||||||
add(InitItems.itemDrillUpgradeFiveByFive);
|
this.add(InitItems.itemDrillUpgradeFiveByFive);
|
||||||
add(InitItems.itemDrillUpgradeBlockPlacing);
|
this.add(InitItems.itemDrillUpgradeBlockPlacing);
|
||||||
add(InitItems.itemBattery);
|
this.add(InitItems.itemBattery);
|
||||||
add(InitItems.itemBatteryDouble);
|
this.add(InitItems.itemBatteryDouble);
|
||||||
add(InitItems.itemBatteryTriple);
|
this.add(InitItems.itemBatteryTriple);
|
||||||
add(InitItems.itemBatteryQuadruple);
|
this.add(InitItems.itemBatteryQuadruple);
|
||||||
add(InitItems.itemBatteryQuintuple);
|
this.add(InitItems.itemBatteryQuintuple);
|
||||||
add(InitItems.itemTeleStaff);
|
this.add(InitItems.itemTeleStaff);
|
||||||
|
|
||||||
add(InitItems.itemGrowthRing);
|
this.add(InitItems.itemGrowthRing);
|
||||||
add(InitItems.itemMagnetRing);
|
this.add(InitItems.itemMagnetRing);
|
||||||
add(InitItems.itemWaterRemovalRing);
|
this.add(InitItems.itemWaterRemovalRing);
|
||||||
|
|
||||||
add(InitItems.itemPhantomConnector);
|
this.add(InitItems.itemPhantomConnector);
|
||||||
add(InitItems.itemBucketCanolaOil);
|
this.add(InitItems.itemBucketCanolaOil);
|
||||||
add(InitItems.itemBucketOil);
|
this.add(InitItems.itemBucketOil);
|
||||||
|
|
||||||
add(InitItems.itemWingsOfTheBats);
|
this.add(InitItems.itemWingsOfTheBats);
|
||||||
|
|
||||||
add(InitItems.itemCoffeeSeed);
|
this.add(InitItems.itemCoffeeSeed);
|
||||||
add(InitItems.itemCoffeeBean);
|
this.add(InitItems.itemCoffeeBean);
|
||||||
add(InitItems.itemRiceSeed);
|
this.add(InitItems.itemRiceSeed);
|
||||||
add(InitItems.itemCanolaSeed);
|
this.add(InitItems.itemCanolaSeed);
|
||||||
add(InitItems.itemFlaxSeed);
|
this.add(InitItems.itemFlaxSeed);
|
||||||
add(InitItems.itemHairyBall);
|
this.add(InitItems.itemHairyBall);
|
||||||
add(InitItems.itemMisc);
|
this.add(InitItems.itemMisc);
|
||||||
add(InitItems.itemResonantRice);
|
this.add(InitItems.itemResonantRice);
|
||||||
add(InitItems.itemFertilizer);
|
this.add(InitItems.itemFertilizer);
|
||||||
|
|
||||||
add(InitItems.itemCoffee);
|
this.add(InitItems.itemCoffee);
|
||||||
add(InitItems.itemFoods);
|
this.add(InitItems.itemFoods);
|
||||||
add(InitItems.itemKnife);
|
this.add(InitItems.itemKnife);
|
||||||
add(InitItems.itemCrafterOnAStick);
|
this.add(InitItems.itemCrafterOnAStick);
|
||||||
add(InitItems.itemDust);
|
this.add(InitItems.itemDust);
|
||||||
add(InitItems.itemSolidifiedExperience);
|
this.add(InitItems.itemSolidifiedExperience);
|
||||||
add(InitItems.itemLeafBlower);
|
this.add(InitItems.itemLeafBlower);
|
||||||
add(InitItems.itemLeafBlowerAdvanced);
|
this.add(InitItems.itemLeafBlowerAdvanced);
|
||||||
|
|
||||||
add(InitItems.woodenPaxel);
|
this.add(InitItems.woodenPaxel);
|
||||||
add(InitItems.stonePaxel);
|
this.add(InitItems.stonePaxel);
|
||||||
add(InitItems.ironPaxel);
|
this.add(InitItems.ironPaxel);
|
||||||
add(InitItems.goldPaxel);
|
this.add(InitItems.goldPaxel);
|
||||||
add(InitItems.diamondPaxel);
|
this.add(InitItems.diamondPaxel);
|
||||||
add(InitItems.emeraldPaxel);
|
this.add(InitItems.emeraldPaxel);
|
||||||
add(InitItems.obsidianPaxel);
|
this.add(InitItems.obsidianPaxel);
|
||||||
add(InitItems.quartzPaxel);
|
this.add(InitItems.quartzPaxel);
|
||||||
add(InitItems.itemPaxelCrystalRed);
|
this.add(InitItems.itemPaxelCrystalRed);
|
||||||
add(InitItems.itemPaxelCrystalBlue);
|
this.add(InitItems.itemPaxelCrystalBlue);
|
||||||
add(InitItems.itemPaxelCrystalLightBlue);
|
this.add(InitItems.itemPaxelCrystalLightBlue);
|
||||||
add(InitItems.itemPaxelCrystalBlack);
|
this.add(InitItems.itemPaxelCrystalBlack);
|
||||||
add(InitItems.itemPaxelCrystalGreen);
|
this.add(InitItems.itemPaxelCrystalGreen);
|
||||||
add(InitItems.itemPaxelCrystalWhite);
|
this.add(InitItems.itemPaxelCrystalWhite);
|
||||||
InitForeignPaxels.addToCreativeTab();
|
InitForeignPaxels.addToCreativeTab();
|
||||||
|
|
||||||
add(InitBlocks.blockCrystal);
|
this.add(InitBlocks.blockCrystal);
|
||||||
add(InitItems.itemCrystal);
|
this.add(InitItems.itemCrystal);
|
||||||
|
|
||||||
add(InitItems.itemJams);
|
this.add(InitItems.itemJams);
|
||||||
|
|
||||||
add(InitItems.itemPotionRing);
|
this.add(InitItems.itemPotionRing);
|
||||||
add(InitItems.itemPotionRingAdvanced);
|
this.add(InitItems.itemPotionRingAdvanced);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeQuartz);
|
this.add(InitItems.itemPickaxeQuartz);
|
||||||
add(InitItems.itemSwordQuartz);
|
this.add(InitItems.itemSwordQuartz);
|
||||||
add(InitItems.itemAxeQuartz);
|
this.add(InitItems.itemAxeQuartz);
|
||||||
add(InitItems.itemShovelQuartz);
|
this.add(InitItems.itemShovelQuartz);
|
||||||
add(InitItems.itemHoeQuartz);
|
this.add(InitItems.itemHoeQuartz);
|
||||||
|
|
||||||
add(InitItems.itemHelmQuartz);
|
this.add(InitItems.itemHelmQuartz);
|
||||||
add(InitItems.itemChestQuartz);
|
this.add(InitItems.itemChestQuartz);
|
||||||
add(InitItems.itemPantsQuartz);
|
this.add(InitItems.itemPantsQuartz);
|
||||||
add(InitItems.itemBootsQuartz);
|
this.add(InitItems.itemBootsQuartz);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeEmerald);
|
this.add(InitItems.itemPickaxeEmerald);
|
||||||
add(InitItems.itemSwordEmerald);
|
this.add(InitItems.itemSwordEmerald);
|
||||||
add(InitItems.itemAxeEmerald);
|
this.add(InitItems.itemAxeEmerald);
|
||||||
add(InitItems.itemShovelEmerald);
|
this.add(InitItems.itemShovelEmerald);
|
||||||
add(InitItems.itemHoeEmerald);
|
this.add(InitItems.itemHoeEmerald);
|
||||||
|
|
||||||
add(InitItems.itemHelmEmerald);
|
this.add(InitItems.itemHelmEmerald);
|
||||||
add(InitItems.itemChestEmerald);
|
this.add(InitItems.itemChestEmerald);
|
||||||
add(InitItems.itemPantsEmerald);
|
this.add(InitItems.itemPantsEmerald);
|
||||||
add(InitItems.itemBootsEmerald);
|
this.add(InitItems.itemBootsEmerald);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeObsidian);
|
this.add(InitItems.itemPickaxeObsidian);
|
||||||
add(InitItems.itemSwordObsidian);
|
this.add(InitItems.itemSwordObsidian);
|
||||||
add(InitItems.itemAxeObsidian);
|
this.add(InitItems.itemAxeObsidian);
|
||||||
add(InitItems.itemShovelObsidian);
|
this.add(InitItems.itemShovelObsidian);
|
||||||
add(InitItems.itemHoeObsidian);
|
this.add(InitItems.itemHoeObsidian);
|
||||||
|
|
||||||
add(InitItems.itemHelmObsidian);
|
this.add(InitItems.itemHelmObsidian);
|
||||||
add(InitItems.itemChestObsidian);
|
this.add(InitItems.itemChestObsidian);
|
||||||
add(InitItems.itemPantsObsidian);
|
this.add(InitItems.itemPantsObsidian);
|
||||||
add(InitItems.itemBootsObsidian);
|
this.add(InitItems.itemBootsObsidian);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalRed);
|
this.add(InitItems.itemPickaxeCrystalRed);
|
||||||
add(InitItems.itemAxeCrystalRed);
|
this.add(InitItems.itemAxeCrystalRed);
|
||||||
add(InitItems.itemShovelCrystalRed);
|
this.add(InitItems.itemShovelCrystalRed);
|
||||||
add(InitItems.itemSwordCrystalRed);
|
this.add(InitItems.itemSwordCrystalRed);
|
||||||
add(InitItems.itemHoeCrystalRed);
|
this.add(InitItems.itemHoeCrystalRed);
|
||||||
add(InitItems.itemHelmCrystalRed);
|
this.add(InitItems.itemHelmCrystalRed);
|
||||||
add(InitItems.itemChestCrystalRed);
|
this.add(InitItems.itemChestCrystalRed);
|
||||||
add(InitItems.itemPantsCrystalRed);
|
this.add(InitItems.itemPantsCrystalRed);
|
||||||
add(InitItems.itemBootsCrystalRed);
|
this.add(InitItems.itemBootsCrystalRed);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalBlue);
|
this.add(InitItems.itemPickaxeCrystalBlue);
|
||||||
add(InitItems.itemAxeCrystalBlue);
|
this.add(InitItems.itemAxeCrystalBlue);
|
||||||
add(InitItems.itemShovelCrystalBlue);
|
this.add(InitItems.itemShovelCrystalBlue);
|
||||||
add(InitItems.itemSwordCrystalBlue);
|
this.add(InitItems.itemSwordCrystalBlue);
|
||||||
add(InitItems.itemHoeCrystalBlue);
|
this.add(InitItems.itemHoeCrystalBlue);
|
||||||
add(InitItems.itemHelmCrystalBlue);
|
this.add(InitItems.itemHelmCrystalBlue);
|
||||||
add(InitItems.itemChestCrystalBlue);
|
this.add(InitItems.itemChestCrystalBlue);
|
||||||
add(InitItems.itemPantsCrystalBlue);
|
this.add(InitItems.itemPantsCrystalBlue);
|
||||||
add(InitItems.itemBootsCrystalBlue);
|
this.add(InitItems.itemBootsCrystalBlue);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalLightBlue);
|
this.add(InitItems.itemPickaxeCrystalLightBlue);
|
||||||
add(InitItems.itemAxeCrystalLightBlue);
|
this.add(InitItems.itemAxeCrystalLightBlue);
|
||||||
add(InitItems.itemShovelCrystalLightBlue);
|
this.add(InitItems.itemShovelCrystalLightBlue);
|
||||||
add(InitItems.itemSwordCrystalLightBlue);
|
this.add(InitItems.itemSwordCrystalLightBlue);
|
||||||
add(InitItems.itemHoeCrystalLightBlue);
|
this.add(InitItems.itemHoeCrystalLightBlue);
|
||||||
add(InitItems.itemHelmCrystalLightBlue);
|
this.add(InitItems.itemHelmCrystalLightBlue);
|
||||||
add(InitItems.itemChestCrystalLightBlue);
|
this.add(InitItems.itemChestCrystalLightBlue);
|
||||||
add(InitItems.itemPantsCrystalLightBlue);
|
this.add(InitItems.itemPantsCrystalLightBlue);
|
||||||
add(InitItems.itemBootsCrystalLightBlue);
|
this.add(InitItems.itemBootsCrystalLightBlue);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalBlack);
|
this.add(InitItems.itemPickaxeCrystalBlack);
|
||||||
add(InitItems.itemAxeCrystalBlack);
|
this.add(InitItems.itemAxeCrystalBlack);
|
||||||
add(InitItems.itemShovelCrystalBlack);
|
this.add(InitItems.itemShovelCrystalBlack);
|
||||||
add(InitItems.itemSwordCrystalBlack);
|
this.add(InitItems.itemSwordCrystalBlack);
|
||||||
add(InitItems.itemHoeCrystalBlack);
|
this.add(InitItems.itemHoeCrystalBlack);
|
||||||
add(InitItems.itemHelmCrystalBlack);
|
this.add(InitItems.itemHelmCrystalBlack);
|
||||||
add(InitItems.itemChestCrystalBlack);
|
this.add(InitItems.itemChestCrystalBlack);
|
||||||
add(InitItems.itemPantsCrystalBlack);
|
this.add(InitItems.itemPantsCrystalBlack);
|
||||||
add(InitItems.itemBootsCrystalBlack);
|
this.add(InitItems.itemBootsCrystalBlack);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalGreen);
|
this.add(InitItems.itemPickaxeCrystalGreen);
|
||||||
add(InitItems.itemAxeCrystalGreen);
|
this.add(InitItems.itemAxeCrystalGreen);
|
||||||
add(InitItems.itemShovelCrystalGreen);
|
this.add(InitItems.itemShovelCrystalGreen);
|
||||||
add(InitItems.itemSwordCrystalGreen);
|
this.add(InitItems.itemSwordCrystalGreen);
|
||||||
add(InitItems.itemHoeCrystalGreen);
|
this.add(InitItems.itemHoeCrystalGreen);
|
||||||
add(InitItems.itemHelmCrystalGreen);
|
this.add(InitItems.itemHelmCrystalGreen);
|
||||||
add(InitItems.itemChestCrystalGreen);
|
this.add(InitItems.itemChestCrystalGreen);
|
||||||
add(InitItems.itemPantsCrystalGreen);
|
this.add(InitItems.itemPantsCrystalGreen);
|
||||||
add(InitItems.itemBootsCrystalGreen);
|
this.add(InitItems.itemBootsCrystalGreen);
|
||||||
|
|
||||||
add(InitItems.itemPickaxeCrystalWhite);
|
this.add(InitItems.itemPickaxeCrystalWhite);
|
||||||
add(InitItems.itemAxeCrystalWhite);
|
this.add(InitItems.itemAxeCrystalWhite);
|
||||||
add(InitItems.itemShovelCrystalWhite);
|
this.add(InitItems.itemShovelCrystalWhite);
|
||||||
add(InitItems.itemSwordCrystalWhite);
|
this.add(InitItems.itemSwordCrystalWhite);
|
||||||
add(InitItems.itemHoeCrystalWhite);
|
this.add(InitItems.itemHoeCrystalWhite);
|
||||||
add(InitItems.itemHelmCrystalWhite);
|
this.add(InitItems.itemHelmCrystalWhite);
|
||||||
add(InitItems.itemChestCrystalWhite);
|
this.add(InitItems.itemChestCrystalWhite);
|
||||||
add(InitItems.itemPantsCrystalWhite);
|
this.add(InitItems.itemPantsCrystalWhite);
|
||||||
add(InitItems.itemBootsCrystalWhite);
|
this.add(InitItems.itemBootsCrystalWhite);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Item item){
|
public void add(Item item){
|
||||||
|
|
|
@ -42,11 +42,11 @@ public class JamVillagerTradeHandler{
|
||||||
|
|
||||||
public void addWants(String oredictName, int minSize, int maxSize){
|
public void addWants(String oredictName, int minSize, int maxSize){
|
||||||
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName);
|
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName);
|
||||||
trades.add(new Trade(stacks, minSize, maxSize));
|
this.trades.add(new Trade(stacks, minSize, maxSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWants(ItemStack stack, int minSize, int maxSize){
|
public void addWants(ItemStack stack, int minSize, int maxSize){
|
||||||
trades.add(new Trade(stack, minSize, maxSize));
|
this.trades.add(new Trade(stack, minSize, maxSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO Fix the Villager
|
//TODO Fix the Villager
|
||||||
|
|
|
@ -46,13 +46,13 @@ public class OreGen implements IWorldGenerator{
|
||||||
if(world.getWorldType() != WorldType.FLAT && Util.arrayContains(ConfigValues.oreGenDimensionBlacklist, world.provider.getDimension()) < 0){
|
if(world.getWorldType() != WorldType.FLAT && Util.arrayContains(ConfigValues.oreGenDimensionBlacklist, world.provider.getDimension()) < 0){
|
||||||
switch(world.provider.getDimension()){
|
switch(world.provider.getDimension()){
|
||||||
case -1:
|
case -1:
|
||||||
generateNether(world, random, chunkX*16, chunkZ*16);
|
this.generateNether(world, random, chunkX*16, chunkZ*16);
|
||||||
//case 0:
|
//case 0:
|
||||||
// generateSurface(world, random, chunkX*16, chunkZ*16);
|
// generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||||
case 1:
|
case 1:
|
||||||
generateEnd(world, random, chunkX*16, chunkZ*16);
|
this.generateEnd(world, random, chunkX*16, chunkZ*16);
|
||||||
default:
|
default:
|
||||||
generateSurface(world, random, chunkX*16, chunkZ*16);
|
this.generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,18 +34,18 @@ public class ContainerCoffeeMachine extends Container{
|
||||||
public ContainerCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile){
|
public ContainerCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
this.machine = (TileEntityCoffeeMachine)tile;
|
this.machine = (TileEntityCoffeeMachine)tile;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6));
|
this.addSlotToContainer(new Slot(this.machine, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6));
|
||||||
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42));
|
this.addSlotToContainer(new Slot(this.machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42));
|
||||||
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73));
|
this.addSlotToContainer(new SlotOutput(this.machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73));
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
for(int j = 0; j < 2; j++){
|
for(int j = 0; j < 2; j++){
|
||||||
this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18));
|
this.addSlotToContainer(new Slot(this.machine, j+i*2+3, 125+j*18, 6+i*18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73));
|
this.addSlotToContainer(new Slot(this.machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73));
|
||||||
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73));
|
this.addSlotToContainer(new SlotOutput(this.machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73));
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++){
|
for(int i = 0; i < 3; i++){
|
||||||
for(int j = 0; j < 9; j++){
|
for(int j = 0; j < 9; j++){
|
||||||
|
@ -64,7 +64,7 @@ public class ContainerCoffeeMachine extends Container{
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
Slot theSlot = this.inventorySlots.get(slot);
|
||||||
|
|
||||||
if(theSlot != null && theSlot.getHasStack()){
|
if(theSlot != null && theSlot.getHasStack()){
|
||||||
ItemStack newStack = theSlot.getStack();
|
ItemStack newStack = theSlot.getStack();
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class ContainerDrill extends Container{
|
||||||
this.inventory = inventory;
|
this.inventory = inventory;
|
||||||
|
|
||||||
for(int i = 0; i < SLOT_AMOUNT; i++){
|
for(int i = 0; i < SLOT_AMOUNT; i++){
|
||||||
this.addSlotToContainer(new Slot(drillInventory, i, 44+i*18, 19){
|
this.addSlotToContainer(new Slot(ContainerDrill.this.drillInventory, i, 44+i*18, 19){
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack){
|
public boolean isItemValid(ItemStack stack){
|
||||||
return stack.getItem() instanceof ItemDrillUpgrade || stack.getItem() instanceof IEnergyContainerItem;
|
return stack.getItem() instanceof ItemDrillUpgrade || stack.getItem() instanceof IEnergyContainerItem;
|
||||||
|
@ -122,7 +122,7 @@ public class ContainerDrill extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
||||||
if(clickTypeIn == ClickType.SWAP && dragType == inventory.currentItem){
|
if(clickTypeIn == ClickType.SWAP && dragType == this.inventory.currentItem){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -132,9 +132,9 @@ public class ContainerDrill extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onContainerClosed(EntityPlayer player){
|
public void onContainerClosed(EntityPlayer player){
|
||||||
ItemStack stack = inventory.getCurrentItem();
|
ItemStack stack = this.inventory.getCurrentItem();
|
||||||
if(stack != null && stack.getItem() instanceof ItemDrill){
|
if(stack != null && stack.getItem() instanceof ItemDrill){
|
||||||
((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem());
|
((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, this.inventory.getCurrentItem());
|
||||||
}
|
}
|
||||||
super.onContainerClosed(player);
|
super.onContainerClosed(player);
|
||||||
}
|
}
|
||||||
|
@ -221,31 +221,31 @@ public class ContainerDrill extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory(){
|
public int getSizeInventory(){
|
||||||
return slots.length;
|
return this.slots.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getStackInSlot(int i){
|
public ItemStack getStackInSlot(int i){
|
||||||
if(i < this.getSizeInventory()){
|
if(i < this.getSizeInventory()){
|
||||||
return slots[i];
|
return this.slots[i];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack decrStackSize(int i, int j){
|
public ItemStack decrStackSize(int i, int j){
|
||||||
if(slots[i] != null){
|
if(this.slots[i] != null){
|
||||||
ItemStack stackAt;
|
ItemStack stackAt;
|
||||||
if(slots[i].stackSize <= j){
|
if(this.slots[i].stackSize <= j){
|
||||||
stackAt = slots[i];
|
stackAt = this.slots[i];
|
||||||
slots[i] = null;
|
this.slots[i] = null;
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
return stackAt;
|
return stackAt;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
stackAt = slots[i].splitStack(j);
|
stackAt = this.slots[i].splitStack(j);
|
||||||
if(slots[i].stackSize == 0){
|
if(this.slots[i].stackSize == 0){
|
||||||
slots[i] = null;
|
this.slots[i] = null;
|
||||||
}
|
}
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
return stackAt;
|
return stackAt;
|
||||||
|
|
|
@ -29,8 +29,8 @@ public class ContainerFluidCollector extends Container{
|
||||||
public ContainerFluidCollector(InventoryPlayer inventory, TileEntityBase tile){
|
public ContainerFluidCollector(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
this.collector = (TileEntityFluidCollector)tile;
|
this.collector = (TileEntityFluidCollector)tile;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(collector, 0, 90, 73));
|
this.addSlotToContainer(new Slot(this.collector, 0, 90, 73));
|
||||||
this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42));
|
this.addSlotToContainer(new SlotOutput(this.collector, 1, 90, 42));
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++){
|
for(int i = 0; i < 3; i++){
|
||||||
for(int j = 0; j < 9; j++){
|
for(int j = 0; j < 9; j++){
|
||||||
|
@ -49,7 +49,7 @@ public class ContainerFluidCollector extends Container{
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
Slot theSlot = this.inventorySlots.get(slot);
|
||||||
|
|
||||||
if(theSlot != null && theSlot.getHasStack()){
|
if(theSlot != null && theSlot.getHasStack()){
|
||||||
ItemStack newStack = theSlot.getStack();
|
ItemStack newStack = theSlot.getStack();
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class ContainerInputter extends Container{
|
||||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
||||||
if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){
|
if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){
|
||||||
//Calls the Filter's SlotClick function
|
//Calls the Filter's SlotClick function
|
||||||
return ((SlotFilter)getSlot(slotId)).slotClick(player);
|
return ((SlotFilter)this.getSlot(slotId)).slotClick(player);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class ContainerRangedCollector extends Container{
|
||||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
|
||||||
if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){
|
if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){
|
||||||
//Calls the Filter's SlotClick function
|
//Calls the Filter's SlotClick function
|
||||||
return ((SlotFilter)getSlot(slotId)).slotClick(player);
|
return ((SlotFilter)this.getSlot(slotId)).slotClick(player);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
return super.slotClick(slotId, dragType, clickTypeIn, player);
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class ContainerXPSolidifier extends Container{
|
||||||
public ContainerXPSolidifier(InventoryPlayer inventory, TileEntityBase tile){
|
public ContainerXPSolidifier(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
this.solidifier = (TileEntityXPSolidifier)tile;
|
this.solidifier = (TileEntityXPSolidifier)tile;
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotOutput(solidifier, 0, 80, 8));
|
this.addSlotToContainer(new SlotOutput(this.solidifier, 0, 80, 8));
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++){
|
for(int i = 0; i < 3; i++){
|
||||||
for(int j = 0; j < 9; j++){
|
for(int j = 0; j < 9; j++){
|
||||||
|
@ -47,7 +47,7 @@ public class ContainerXPSolidifier extends Container{
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
Slot theSlot = this.inventorySlots.get(slot);
|
||||||
|
|
||||||
if(theSlot != null && theSlot.getHasStack()){
|
if(theSlot != null && theSlot.getHasStack()){
|
||||||
ItemStack newStack = theSlot.getStack();
|
ItemStack newStack = theSlot.getStack();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class GuiBreaker extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.breaker.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,19 +41,19 @@ public class GuiCanolaPress extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
String text2 = StringUtil.getFluidInfo(this.press.tank);
|
String text2 = StringUtil.getFluidInfo(this.press.tank);
|
||||||
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
if(x >= this.guiLeft+117 && y >= this.guiTop+6 && x <= this.guiLeft+132 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.press.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,17 +68,17 @@ public class GuiCanolaPress extends GuiContainer{
|
||||||
|
|
||||||
if(this.press.storage.getEnergyStored() > 0){
|
if(this.press.storage.getEnergyStored() > 0){
|
||||||
int i = this.press.getEnergyScaled(83);
|
int i = this.press.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.press.tank.getFluidAmount() > 0){
|
if(this.press.tank.getFluidAmount() > 0){
|
||||||
int i = this.press.getTankScaled(83);
|
int i = this.press.getTankScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.press.currentProcessTime > 0){
|
if(this.press.currentProcessTime > 0){
|
||||||
int i = this.press.getProcessScaled(29);
|
int i = this.press.getProcessScaled(29);
|
||||||
drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i);
|
this.drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,14 +40,14 @@ public class GuiCoalGenerator extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.generator.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,12 +62,12 @@ public class GuiCoalGenerator extends GuiContainer{
|
||||||
|
|
||||||
if(this.generator.storage.getEnergyStored() > 0){
|
if(this.generator.storage.getEnergyStored() > 0){
|
||||||
int i = this.generator.getEnergyScaled(83);
|
int i = this.generator.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.generator.currentBurnTime > 0){
|
if(this.generator.currentBurnTime > 0){
|
||||||
int i = this.generator.getBurningScaled(13);
|
int i = this.generator.getBurningScaled(13);
|
||||||
this.drawTexturedModalRect(guiLeft+87, guiTop+27+12-i, 176, 96-i, 14, i);
|
this.drawTexturedModalRect(this.guiLeft+87, this.guiTop+27+12-i, 176, 96-i, 14, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -56,7 +56,7 @@ public class GuiCoffeeMachine extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
GuiButton buttonOkay = new GuiButton(0, guiLeft+60, guiTop+11, 58, 20, StringUtil.localize("info."+ModUtil.MOD_ID+".gui.ok"));
|
GuiButton buttonOkay = new GuiButton(0, this.guiLeft+60, this.guiTop+11, 58, 20, StringUtil.localize("info."+ModUtil.MOD_ID+".gui.ok"));
|
||||||
this.buttonList.add(buttonOkay);
|
this.buttonList.add(buttonOkay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,23 +65,23 @@ public class GuiCoffeeMachine extends GuiContainer{
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
|
if(x >= this.guiLeft+16 && y >= this.guiTop+5 && x <= this.guiLeft+23 && y <= this.guiTop+89){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
String text3 = StringUtil.getFluidInfo(this.machine.tank);
|
String text3 = StringUtil.getFluidInfo(this.machine.tank);
|
||||||
if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
|
if(x >= this.guiLeft+27 && y >= this.guiTop+5 && x <= this.guiLeft+33 && y <= this.guiTop+70){
|
||||||
this.drawHoveringText(Collections.singletonList(text3), x, y);
|
this.drawHoveringText(Collections.singletonList(text3), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.coffee");
|
String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.coffee");
|
||||||
if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
|
if(x >= this.guiLeft+40 && y >= this.guiTop+25 && x <= this.guiLeft+49 && y <= this.guiTop+56){
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.machine.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.machine.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,29 +96,29 @@ public class GuiCoffeeMachine extends GuiContainer{
|
||||||
|
|
||||||
if(this.machine.storage.getEnergyStored() > 0){
|
if(this.machine.storage.getEnergyStored() > 0){
|
||||||
int i = this.machine.getEnergyScaled(83);
|
int i = this.machine.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+17, this.guiTop+89-i, 176, 0, 6, i);
|
this.drawTexturedModalRect(this.guiLeft+17, this.guiTop+89-i, 176, 0, 6, i);
|
||||||
}
|
}
|
||||||
if(this.machine.tank.getFluidAmount() > 0){
|
if(this.machine.tank.getFluidAmount() > 0){
|
||||||
int i = this.machine.getWaterScaled(64);
|
int i = this.machine.getWaterScaled(64);
|
||||||
drawTexturedModalRect(this.guiLeft+27, this.guiTop+70-i, 182, 0, 6, i);
|
this.drawTexturedModalRect(this.guiLeft+27, this.guiTop+70-i, 182, 0, 6, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.machine.coffeeCacheAmount > 0){
|
if(this.machine.coffeeCacheAmount > 0){
|
||||||
int i = this.machine.getCoffeeScaled(30);
|
int i = this.machine.getCoffeeScaled(30);
|
||||||
drawTexturedModalRect(this.guiLeft+41, this.guiTop+56-i, 192, 0, 8, i);
|
this.drawTexturedModalRect(this.guiLeft+41, this.guiTop+56-i, 192, 0, 8, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.machine.brewTime > 0){
|
if(this.machine.brewTime > 0){
|
||||||
int i = this.machine.getBrewScaled(23);
|
int i = this.machine.getBrewScaled(23);
|
||||||
drawTexturedModalRect(this.guiLeft+53, this.guiTop+42, 192, 30, i, 16);
|
this.drawTexturedModalRect(this.guiLeft+53, this.guiTop+42, 192, 30, i, 16);
|
||||||
|
|
||||||
int j = this.machine.getBrewScaled(26);
|
int j = this.machine.getBrewScaled(26);
|
||||||
drawTexturedModalRect(this.guiLeft+99+25-j, this.guiTop+44, 192+25-j, 46, j, 12);
|
this.drawTexturedModalRect(this.guiLeft+99+25-j, this.guiTop+44, 192+25-j, 46, j, 12);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(this.x, this.y, this.z, this.world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,7 +34,7 @@ public class GuiCrafter extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, "container."+ModUtil.MOD_ID+".crafting");
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID+".crafting");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,14 +41,14 @@ public class GuiDirectionalBreaker extends GuiContainer{
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
String text1 = this.breaker.storage.getEnergyStored()+"/"+this.breaker.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.breaker.storage.getEnergyStored()+"/"+this.breaker.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.breaker.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,7 +63,7 @@ public class GuiDirectionalBreaker extends GuiContainer{
|
||||||
|
|
||||||
if(this.breaker.storage.getEnergyStored() > 0){
|
if(this.breaker.storage.getEnergyStored() > 0){
|
||||||
int i = this.breaker.getEnergyScaled(83);
|
int i = this.breaker.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ public class GuiDrill extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, "container."+ModUtil.MOD_ID+".drill");
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID+".drill");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class GuiDropper extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.dropper.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -40,14 +40,14 @@ public class GuiEnergizer extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
if(x >= this.guiLeft+57 && y >= this.guiTop+6 && x <= this.guiLeft+72 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.energizer.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +62,7 @@ public class GuiEnergizer extends GuiContainer{
|
||||||
|
|
||||||
if(this.energizer.storage.getEnergyStored() > 0){
|
if(this.energizer.storage.getEnergyStored() > 0){
|
||||||
int i = this.energizer.getEnergyScaled(83);
|
int i = this.energizer.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,14 +40,14 @@ public class GuiEnervator extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
|
if(x >= this.guiLeft+57 && y >= this.guiTop+6 && x <= this.guiLeft+72 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.enervator.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +62,7 @@ public class GuiEnervator extends GuiContainer{
|
||||||
|
|
||||||
if(this.enervator.storage.getEnergyStored() > 0){
|
if(this.enervator.storage.getEnergyStored() > 0){
|
||||||
int i = this.enervator.getEnergyScaled(83);
|
int i = this.enervator.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -41,7 +41,7 @@ public class GuiFeeder extends GuiContainer{
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){
|
if(x >= this.guiLeft+69 && y >= this.guiTop+30 && x <= this.guiLeft+69+10 && y <= this.guiTop+30+10){
|
||||||
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD) ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.notEnough")))};
|
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD) ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.notEnough")))};
|
||||||
this.drawHoveringText(Arrays.asList(array), x, y);
|
this.drawHoveringText(Arrays.asList(array), x, y);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class GuiFeeder extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFeeder.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileFeeder.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,15 +62,15 @@ public class GuiFeeder extends GuiContainer{
|
||||||
|
|
||||||
if(this.tileFeeder.currentTimer > 0){
|
if(this.tileFeeder.currentTimer > 0){
|
||||||
int i = this.tileFeeder.getCurrentTimerToScale(20);
|
int i = this.tileFeeder.getCurrentTimerToScale(20);
|
||||||
this.drawTexturedModalRect(guiLeft+85, guiTop+42-i, 181, 19+19-i, 6, 20);
|
this.drawTexturedModalRect(this.guiLeft+85, this.guiTop+42-i, 181, 19+19-i, 6, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD){
|
if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD){
|
||||||
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 16, 8, 8);
|
this.drawTexturedModalRect(this.guiLeft+70, this.guiTop+31, 192, 16, 8, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD){
|
if(this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD){
|
||||||
this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8);
|
this.drawTexturedModalRect(this.guiLeft+70, this.guiTop+31, 192, 24, 8, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -42,19 +42,19 @@ public class GuiFermentingBarrel extends GuiContainer{
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
String text1 = StringUtil.getFluidInfo(this.press.canolaTank);
|
String text1 = StringUtil.getFluidInfo(this.press.canolaTank);
|
||||||
if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){
|
if(x >= this.guiLeft+61 && y >= this.guiTop+6 && x <= this.guiLeft+76 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
String text2 = StringUtil.getFluidInfo(this.press.oilTank);
|
String text2 = StringUtil.getFluidInfo(this.press.oilTank);
|
||||||
if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){
|
if(x >= this.guiLeft+99 && y >= this.guiTop+6 && x <= this.guiLeft+114 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.press.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,17 +69,17 @@ public class GuiFermentingBarrel extends GuiContainer{
|
||||||
|
|
||||||
if(this.press.canolaTank.getFluidAmount() > 0){
|
if(this.press.canolaTank.getFluidAmount() > 0){
|
||||||
int i = this.press.getCanolaTankScaled(83);
|
int i = this.press.getCanolaTankScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.press.oilTank.getFluidAmount() > 0){
|
if(this.press.oilTank.getFluidAmount() > 0){
|
||||||
int i = this.press.getOilTankScaled(83);
|
int i = this.press.getOilTankScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.press.currentProcessTime > 0){
|
if(this.press.currentProcessTime > 0){
|
||||||
int i = this.press.getProcessScaled(29);
|
int i = this.press.getProcessScaled(29);
|
||||||
drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i);
|
this.drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -42,14 +42,14 @@ public class GuiFluidCollector extends GuiContainer{
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
String text2 = StringUtil.getFluidInfo(this.collector.tank);
|
String text2 = StringUtil.getFluidInfo(this.collector.tank);
|
||||||
if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){
|
if(x >= this.guiLeft+68 && y >= this.guiTop+6 && x <= this.guiLeft+83 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.collector.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,7 +64,7 @@ public class GuiFluidCollector extends GuiContainer{
|
||||||
|
|
||||||
if(this.collector.tank.getFluidAmount() > 0){
|
if(this.collector.tank.getFluidAmount() > 0){
|
||||||
int i = this.collector.getTankScaled(83);
|
int i = this.collector.getTankScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,14 +40,14 @@ public class GuiFurnaceDouble extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
|
String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
if(x >= this.guiLeft+28 && y >= this.guiTop+6 && x <= this.guiLeft+43 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text), x, y);
|
this.drawHoveringText(Collections.singletonList(text), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileFurnace.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +62,7 @@ public class GuiFurnaceDouble extends GuiContainer{
|
||||||
|
|
||||||
if(this.tileFurnace.storage.getEnergyStored() > 0){
|
if(this.tileFurnace.storage.getEnergyStored() > 0){
|
||||||
int i = this.tileFurnace.getEnergyScaled(83);
|
int i = this.tileFurnace.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i);
|
||||||
}
|
}
|
||||||
if(this.tileFurnace.firstSmeltTime > 0){
|
if(this.tileFurnace.firstSmeltTime > 0){
|
||||||
int i = this.tileFurnace.getFirstTimeToScale(23);
|
int i = this.tileFurnace.getFirstTimeToScale(23);
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class GuiGiantChest extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.chest.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.chest.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,14 +47,14 @@ public class GuiGrinder extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF";
|
String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF";
|
||||||
if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){
|
if((this.isDouble && x >= this.guiLeft+14 && y >= this.guiTop+6 && x <= this.guiLeft+29 && y <= this.guiTop+88) || (!this.isDouble && x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88)){
|
||||||
this.drawHoveringText(Collections.singletonList(text), x, y);
|
this.drawHoveringText(Collections.singletonList(text), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileGrinder.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileGrinder.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,11 +69,11 @@ public class GuiGrinder extends GuiContainer{
|
||||||
|
|
||||||
if(this.tileGrinder.storage.getEnergyStored() > 0){
|
if(this.tileGrinder.storage.getEnergyStored() > 0){
|
||||||
int i = this.tileGrinder.getEnergyScaled(83);
|
int i = this.tileGrinder.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+(isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i);
|
this.drawTexturedModalRect(this.guiLeft+(this.isDouble ? 14 : 43), this.guiTop+89-i, 176, (this.isDouble ? 44 : 23), 16, i);
|
||||||
}
|
}
|
||||||
if(this.tileGrinder.firstCrushTime > 0){
|
if(this.tileGrinder.firstCrushTime > 0){
|
||||||
int i = this.tileGrinder.getFirstTimeToScale(23);
|
int i = this.tileGrinder.getFirstTimeToScale(23);
|
||||||
this.drawTexturedModalRect(this.guiLeft+(isDouble ? 51 : 80), this.guiTop+40, 176, 0, 24, i);
|
this.drawTexturedModalRect(this.guiLeft+(this.isDouble ? 51 : 80), this.guiTop+40, 176, 0, 24, i);
|
||||||
}
|
}
|
||||||
if(this.isDouble){
|
if(this.isDouble){
|
||||||
if(this.tileGrinder.secondCrushTime > 0){
|
if(this.tileGrinder.secondCrushTime > 0){
|
||||||
|
|
|
@ -80,39 +80,39 @@ public class GuiInputter extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
this.fieldPullStart = new GuiTextField(3000, this.fontRendererObj, guiLeft+13, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
this.fieldPullStart = new GuiTextField(3000, this.fontRendererObj, this.guiLeft+13, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
||||||
this.fieldPullStart.setMaxStringLength(4);
|
this.fieldPullStart.setMaxStringLength(4);
|
||||||
this.fieldPullStart.setEnableBackgroundDrawing(false);
|
this.fieldPullStart.setEnableBackgroundDrawing(false);
|
||||||
this.fieldPullEnd = new GuiTextField(3001, this.fontRendererObj, guiLeft+50, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
this.fieldPullEnd = new GuiTextField(3001, this.fontRendererObj, this.guiLeft+50, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
||||||
this.fieldPullEnd.setMaxStringLength(4);
|
this.fieldPullEnd.setMaxStringLength(4);
|
||||||
this.fieldPullEnd.setEnableBackgroundDrawing(false);
|
this.fieldPullEnd.setEnableBackgroundDrawing(false);
|
||||||
|
|
||||||
this.fieldPutStart = new GuiTextField(3002, this.fontRendererObj, guiLeft+98, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
this.fieldPutStart = new GuiTextField(3002, this.fontRendererObj, this.guiLeft+98, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
||||||
this.fieldPutStart.setMaxStringLength(4);
|
this.fieldPutStart.setMaxStringLength(4);
|
||||||
this.fieldPutStart.setEnableBackgroundDrawing(false);
|
this.fieldPutStart.setEnableBackgroundDrawing(false);
|
||||||
this.fieldPutEnd = new GuiTextField(3004, this.fontRendererObj, guiLeft+135, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
this.fieldPutEnd = new GuiTextField(3004, this.fontRendererObj, this.guiLeft+135, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
|
||||||
this.fieldPutEnd.setMaxStringLength(4);
|
this.fieldPutEnd.setMaxStringLength(4);
|
||||||
this.fieldPutEnd.setEnableBackgroundDrawing(false);
|
this.fieldPutEnd.setEnableBackgroundDrawing(false);
|
||||||
|
|
||||||
SmallerButton buttonSidePutP = new SmallerButton(0, guiLeft+155, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), ">");
|
SmallerButton buttonSidePutP = new SmallerButton(0, this.guiLeft+155, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), ">");
|
||||||
SmallerButton buttonSidePutM = new SmallerButton(1, guiLeft+90, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), "<");
|
SmallerButton buttonSidePutM = new SmallerButton(1, this.guiLeft+90, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), "<");
|
||||||
|
|
||||||
SmallerButton buttonSidePullP = new SmallerButton(2, guiLeft+70, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), ">");
|
SmallerButton buttonSidePullP = new SmallerButton(2, this.guiLeft+70, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), ">");
|
||||||
SmallerButton buttonSidePullM = new SmallerButton(3, guiLeft+5, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), "<");
|
SmallerButton buttonSidePullM = new SmallerButton(3, this.guiLeft+5, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), "<");
|
||||||
|
|
||||||
whitelistPull = new SmallerButton(TileEntityInputter.WHITELIST_PULL_BUTTON_ID, guiLeft+3, guiTop+16, "");
|
this.whitelistPull = new SmallerButton(TileEntityInputter.WHITELIST_PULL_BUTTON_ID, this.guiLeft+3, this.guiTop+16, "");
|
||||||
whitelistPut = new SmallerButton(TileEntityInputter.WHITELIST_PUT_BUTTON_ID, guiLeft+157, guiTop+16, "");
|
this.whitelistPut = new SmallerButton(TileEntityInputter.WHITELIST_PUT_BUTTON_ID, this.guiLeft+157, this.guiTop+16, "");
|
||||||
|
|
||||||
this.buttonList.add(buttonSidePutP);
|
this.buttonList.add(buttonSidePutP);
|
||||||
this.buttonList.add(buttonSidePullP);
|
this.buttonList.add(buttonSidePullP);
|
||||||
this.buttonList.add(buttonSidePutM);
|
this.buttonList.add(buttonSidePutM);
|
||||||
this.buttonList.add(buttonSidePullM);
|
this.buttonList.add(buttonSidePullM);
|
||||||
if(this.isAdvanced){
|
if(this.isAdvanced){
|
||||||
this.buttonList.add(whitelistPut);
|
this.buttonList.add(this.whitelistPut);
|
||||||
this.buttonList.add(whitelistPull);
|
this.buttonList.add(this.whitelistPull);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, guiLeft+84, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0)));
|
this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, this.guiLeft+84, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -126,14 +126,14 @@ public class GuiInputter extends GuiContainer{
|
||||||
if(this.isAdvanced){
|
if(this.isAdvanced){
|
||||||
List infoList = this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.whitelistInfo"), 200);
|
List infoList = this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.whitelistInfo"), 200);
|
||||||
String text1 = this.tileInputter.isPullWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
String text1 = this.tileInputter.isPullWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
||||||
if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){
|
if(x >= this.guiLeft+3 && y >= this.guiTop+16 && x <= this.guiLeft+18 && y <= this.guiTop+31){
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(TextFormatting.BOLD+text1);
|
list.add(TextFormatting.BOLD+text1);
|
||||||
list.addAll(infoList);
|
list.addAll(infoList);
|
||||||
this.drawHoveringText(list, x, y);
|
this.drawHoveringText(list, x, y);
|
||||||
}
|
}
|
||||||
String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
||||||
if(x >= guiLeft+157 && y >= guiTop+16 && x <= guiLeft+172 && y <= guiTop+31){
|
if(x >= this.guiLeft+157 && y >= this.guiTop+16 && x <= this.guiLeft+172 && y <= this.guiTop+31){
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(TextFormatting.BOLD+text2);
|
list.add(TextFormatting.BOLD+text2);
|
||||||
list.addAll(infoList);
|
list.addAll(infoList);
|
||||||
|
@ -143,23 +143,23 @@ public class GuiInputter extends GuiContainer{
|
||||||
|
|
||||||
int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0);
|
int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0);
|
||||||
//Info Mode on!
|
//Info Mode on!
|
||||||
if(x >= guiLeft+11 && y >= newTopOffset+65 && x <= guiLeft+11+31 && y <= newTopOffset+65+12){
|
if(x >= this.guiLeft+11 && y >= newTopOffset+65 && x <= this.guiLeft+11+31 && y <= newTopOffset+65+12){
|
||||||
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y);
|
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y);
|
||||||
}
|
}
|
||||||
if(x >= guiLeft+96 && y >= newTopOffset+65 && x <= guiLeft+96+31 && y <= newTopOffset+65+12){
|
if(x >= this.guiLeft+96 && y >= newTopOffset+65 && x <= this.guiLeft+96+31 && y <= newTopOffset+65+12){
|
||||||
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y);
|
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y);
|
||||||
}
|
}
|
||||||
if(x >= guiLeft+48 && y >= newTopOffset+65 && x <= guiLeft+48+31 && y <= newTopOffset+65+12){
|
if(x >= this.guiLeft+48 && y >= newTopOffset+65 && x <= this.guiLeft+48+31 && y <= newTopOffset+65+12){
|
||||||
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y);
|
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y);
|
||||||
}
|
}
|
||||||
if(x >= guiLeft+133 && y >= newTopOffset+65 && x <= guiLeft+133+31 && y <= newTopOffset+65+12){
|
if(x >= this.guiLeft+133 && y >= newTopOffset+65 && x <= this.guiLeft+133+31 && y <= newTopOffset+65+12){
|
||||||
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y);
|
this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileInputter.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -167,21 +167,21 @@ public class GuiInputter extends GuiContainer{
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(this.isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86);
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc);
|
this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(isAdvanced ? OFFSET_ADVANCED : 0));
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(this.isAdvanced ? OFFSET_ADVANCED : 0));
|
||||||
|
|
||||||
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull"), this.guiLeft+22+3, this.guiTop+32+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put"), this.guiLeft+107+3, this.guiTop+32+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft+24+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.fontRendererObj.drawString(sideString[this.tileInputter.sideToPull+1], this.guiLeft+24+1, this.guiTop+45+3+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft+109+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.fontRendererObj.drawString(sideString[this.tileInputter.sideToPut+1], this.guiLeft+109+1, this.guiTop+45+3+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
|
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), guiLeft+99, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft+99, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), guiLeft+136, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft+136, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), guiLeft+14, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft+14, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), guiLeft+51, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft+51, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
|
|
||||||
this.fieldPutStart.drawTextBox();
|
this.fieldPutStart.drawTextBox();
|
||||||
this.fieldPutEnd.drawTextBox();
|
this.fieldPutEnd.drawTextBox();
|
||||||
|
@ -238,13 +238,13 @@ public class GuiInputter extends GuiContainer{
|
||||||
|
|
||||||
public void setVariable(GuiTextField field, int sendInt){
|
public void setVariable(GuiTextField field, int sendInt){
|
||||||
if(!field.getText().isEmpty()){
|
if(!field.getText().isEmpty()){
|
||||||
this.sendPacket(parse(field.getText()), sendInt);
|
this.sendPacket(this.parse(field.getText()), sendInt);
|
||||||
field.setText("");
|
field.setText("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendPacket(int text, int textID){
|
private void sendPacket(int text, int textID){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiNumber(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiNumber(this.x, this.y, this.z, this.world, text, textID, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int parse(String theInt){
|
private int parse(String theInt){
|
||||||
|
@ -265,7 +265,7 @@ public class GuiInputter extends GuiContainer{
|
||||||
this.setVariable(this.fieldPullEnd, 3);
|
this.setVariable(this.fieldPullEnd, 3);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(this.x, this.y, this.z, this.world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ public class GuiInputter extends GuiContainer{
|
||||||
@Override
|
@Override
|
||||||
public void drawButton(Minecraft mc, int x, int y){
|
public void drawButton(Minecraft mc, int x, int y){
|
||||||
if(this.visible){
|
if(this.visible){
|
||||||
mc.getTextureManager().bindTexture(resLoc);
|
mc.getTextureManager().bindTexture(this.resLoc);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
|
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
|
||||||
int k = this.getHoverState(this.hovered);
|
int k = this.getHoverState(this.hovered);
|
||||||
|
@ -291,8 +291,8 @@ public class GuiInputter extends GuiContainer{
|
||||||
this.mouseDragged(mc, x, y);
|
this.mouseDragged(mc, x, y);
|
||||||
|
|
||||||
int color = 14737632;
|
int color = 14737632;
|
||||||
if(packedFGColour != 0){
|
if(this.packedFGColour != 0){
|
||||||
color = packedFGColour;
|
color = this.packedFGColour;
|
||||||
}
|
}
|
||||||
else if(!this.enabled){
|
else if(!this.enabled){
|
||||||
color = 10526880;
|
color = 10526880;
|
||||||
|
@ -317,7 +317,7 @@ public class GuiInputter extends GuiContainer{
|
||||||
@Override
|
@Override
|
||||||
public void drawButton(Minecraft mc, int x, int y){
|
public void drawButton(Minecraft mc, int x, int y){
|
||||||
if(this.visible){
|
if(this.visible){
|
||||||
mc.getTextureManager().bindTexture(resLoc);
|
mc.getTextureManager().bindTexture(this.resLoc);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
|
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
|
||||||
int k = this.getHoverState(this.hovered);
|
int k = this.getHoverState(this.hovered);
|
||||||
|
|
|
@ -44,10 +44,10 @@ public class GuiMiner extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
GuiButton buttonMode = new GuiButton(0, guiLeft+xSize/2-51, guiTop+75, 50, 20, "Mode");
|
GuiButton buttonMode = new GuiButton(0, this.guiLeft+this.xSize/2-51, this.guiTop+75, 50, 20, "Mode");
|
||||||
this.buttonList.add(buttonMode);
|
this.buttonList.add(buttonMode);
|
||||||
|
|
||||||
GuiButton buttonReset = new GuiButton(1, guiLeft+xSize/2+1, guiTop+75, 50, 20, "Reset");
|
GuiButton buttonReset = new GuiButton(1, this.guiLeft+this.xSize/2+1, this.guiTop+75, 50, 20, "Reset");
|
||||||
this.buttonList.add(buttonReset);
|
this.buttonList.add(buttonReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class GuiMiner extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.miner.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.miner.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,11 +72,11 @@ public class GuiMiner extends GuiContainer{
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
|
|
||||||
String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything";
|
String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything";
|
||||||
this.fontRendererObj.drawString(mining, this.guiLeft+this.xSize/2-fontRendererObj.getStringWidth(mining)/2, guiTop+8, StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
this.fontRendererObj.drawString(mining, this.guiLeft+this.xSize/2-this.fontRendererObj.getStringWidth(mining)/2, this.guiTop+8, StringUtil.DECIMAL_COLOR_GRAY_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(miner.getPos().getX(), miner.getPos().getY(), miner.getPos().getZ(), miner.getWorld(), button.id, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(this.miner.getPos().getX(), this.miner.getPos().getY(), this.miner.getPos().getZ(), this.miner.getWorld(), button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -41,18 +41,18 @@ public class GuiOilGenerator extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
String text2 = StringUtil.getFluidInfo(this.generator.tank);
|
String text2 = StringUtil.getFluidInfo(this.generator.tank);
|
||||||
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
if(x >= this.guiLeft+117 && y >= this.guiTop+6 && x <= this.guiLeft+132 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
this.drawHoveringText(Collections.singletonList(text2), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.generator.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,17 +67,17 @@ public class GuiOilGenerator extends GuiContainer{
|
||||||
|
|
||||||
if(this.generator.storage.getEnergyStored() > 0){
|
if(this.generator.storage.getEnergyStored() > 0){
|
||||||
int i = this.generator.getEnergyScaled(83);
|
int i = this.generator.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.generator.tank.getFluidAmount() > 0){
|
if(this.generator.tank.getFluidAmount() > 0){
|
||||||
int i = this.generator.getTankScaled(83);
|
int i = this.generator.getTankScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.generator.currentBurnTime > 0){
|
if(this.generator.currentBurnTime > 0){
|
||||||
int i = this.generator.getBurningScaled(13);
|
int i = this.generator.getBurningScaled(13);
|
||||||
this.drawTexturedModalRect(guiLeft+72, guiTop+44+12-i, 176, 96-i, 14, i);
|
this.drawTexturedModalRect(this.guiLeft+72, this.guiTop+44+12-i, 176, 96-i, 14, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -41,7 +41,7 @@ public class GuiPhantomPlacer extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.placer.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class GuiRangedCollector extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
this.whitelistButton = new GuiInputter.SmallerButton(0, guiLeft+3, guiTop+16, "");
|
this.whitelistButton = new GuiInputter.SmallerButton(0, this.guiLeft+3, this.guiTop+16, "");
|
||||||
this.buttonList.add(this.whitelistButton);
|
this.buttonList.add(this.whitelistButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,14 +71,14 @@ public class GuiRangedCollector extends GuiContainer{
|
||||||
this.whitelistButton.displayString = this.collector.isWhitelist ? "O" : "X";
|
this.whitelistButton.displayString = this.collector.isWhitelist ? "O" : "X";
|
||||||
|
|
||||||
String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist");
|
||||||
if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){
|
if(x >= this.guiLeft+3 && y >= this.guiTop+16 && x <= this.guiLeft+18 && y <= this.guiTop+31){
|
||||||
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
this.drawHoveringText(Collections.singletonList(text1), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.collector.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,6 +94,6 @@ public class GuiRangedCollector extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(this.x, this.y, this.z, this.world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,14 +40,14 @@ public class GuiRepairer extends GuiContainer{
|
||||||
public void drawScreen(int x, int y, float f){
|
public void drawScreen(int x, int y, float f){
|
||||||
super.drawScreen(x, y, f);
|
super.drawScreen(x, y, f);
|
||||||
String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF";
|
String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF";
|
||||||
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
|
if(x >= this.guiLeft+28 && y >= this.guiTop+6 && x <= this.guiLeft+43 && y <= this.guiTop+88){
|
||||||
this.drawHoveringText(Collections.singletonList(text), x, y);
|
this.drawHoveringText(Collections.singletonList(text), x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileRepairer.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileRepairer.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +62,7 @@ public class GuiRepairer extends GuiContainer{
|
||||||
|
|
||||||
if(this.tileRepairer.storage.getEnergyStored() > 0){
|
if(this.tileRepairer.storage.getEnergyStored() > 0){
|
||||||
int i = this.tileRepairer.getEnergyScaled(83);
|
int i = this.tileRepairer.getEnergyScaled(83);
|
||||||
drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i);
|
this.drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i);
|
||||||
}
|
}
|
||||||
if(TileEntityItemRepairer.canBeRepaired(this.tileRepairer.slots[TileEntityItemRepairer.SLOT_INPUT])){
|
if(TileEntityItemRepairer.canBeRepaired(this.tileRepairer.slots[TileEntityItemRepairer.SLOT_INPUT])){
|
||||||
int i = this.tileRepairer.getItemDamageToScale(22);
|
int i = this.tileRepairer.getItemDamageToScale(22);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
this.nameField = new GuiTextField(4000, this.fontRendererObj, guiLeft+5, guiTop+6, 114, 8);
|
this.nameField = new GuiTextField(4000, this.fontRendererObj, this.guiLeft+5, this.guiTop+6, 114, 8);
|
||||||
this.nameField.setMaxStringLength(20);
|
this.nameField.setMaxStringLength(20);
|
||||||
this.nameField.setEnableBackgroundDrawing(false);
|
this.nameField.setEnableBackgroundDrawing(false);
|
||||||
this.nameField.setFocused(true);
|
this.nameField.setFocused(true);
|
||||||
|
@ -75,9 +75,9 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
String name = cloud.name == null || cloud.name.isEmpty() ? "" : TextFormatting.GOLD+cloud.name+TextFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.the")+" ";
|
String name = this.cloud.name == null || this.cloud.name.isEmpty() ? "" : TextFormatting.GOLD+this.cloud.name+TextFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.the")+" ";
|
||||||
String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID+".cloud.name");
|
String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID+".cloud.name");
|
||||||
this.fontRendererObj.drawString(localizedName, xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE);
|
this.fontRendererObj.drawString(localizedName, this.xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -123,6 +123,6 @@ public class GuiSmileyCloud extends GuiContainer{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendPacket(String text, int textID){
|
private void sendPacket(String text, int textID){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiString(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiString(this.x, this.y, this.z, this.world, text, textID, Minecraft.getMinecraft().thePlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -53,15 +53,15 @@ public class GuiXPSolidifier extends GuiContainer{
|
||||||
public void initGui(){
|
public void initGui(){
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
GuiButton buttonOne = new GuiInputter.SmallerButton(0, guiLeft+62, guiTop+44, "1");
|
GuiButton buttonOne = new GuiInputter.SmallerButton(0, this.guiLeft+62, this.guiTop+44, "1");
|
||||||
GuiButton buttonFive = new GuiInputter.SmallerButton(1, guiLeft+80, guiTop+44, "5");
|
GuiButton buttonFive = new GuiInputter.SmallerButton(1, this.guiLeft+80, this.guiTop+44, "5");
|
||||||
GuiButton buttonTen = new GuiInputter.SmallerButton(2, guiLeft+99, guiTop+44, "10");
|
GuiButton buttonTen = new GuiInputter.SmallerButton(2, this.guiLeft+99, this.guiTop+44, "10");
|
||||||
GuiButton buttonTwenty = new GuiInputter.SmallerButton(3, guiLeft+62, guiTop+61, "20");
|
GuiButton buttonTwenty = new GuiInputter.SmallerButton(3, this.guiLeft+62, this.guiTop+61, "20");
|
||||||
GuiButton buttonThirty = new GuiInputter.SmallerButton(4, guiLeft+80, guiTop+61, "30");
|
GuiButton buttonThirty = new GuiInputter.SmallerButton(4, this.guiLeft+80, this.guiTop+61, "30");
|
||||||
GuiButton buttonForty = new GuiInputter.SmallerButton(5, guiLeft+99, guiTop+61, "40");
|
GuiButton buttonForty = new GuiInputter.SmallerButton(5, this.guiLeft+99, this.guiTop+61, "40");
|
||||||
GuiButton buttonFifty = new GuiInputter.SmallerButton(6, guiLeft+62, guiTop+78, "50");
|
GuiButton buttonFifty = new GuiInputter.SmallerButton(6, this.guiLeft+62, this.guiTop+78, "50");
|
||||||
GuiButton buttonSixtyFour = new GuiInputter.SmallerButton(7, guiLeft+80, guiTop+78, "64");
|
GuiButton buttonSixtyFour = new GuiInputter.SmallerButton(7, this.guiLeft+80, this.guiTop+78, "64");
|
||||||
GuiButton buttonAll = new GuiInputter.SmallerButton(8, guiLeft+99, guiTop+78, "All");
|
GuiButton buttonAll = new GuiInputter.SmallerButton(8, this.guiLeft+99, this.guiTop+78, "All");
|
||||||
|
|
||||||
this.buttonList.add(buttonOne);
|
this.buttonList.add(buttonOne);
|
||||||
this.buttonList.add(buttonFive);
|
this.buttonList.add(buttonFive);
|
||||||
|
@ -81,7 +81,7 @@ public class GuiXPSolidifier extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.solidifier.getName());
|
AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.solidifier.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,12 +94,12 @@ public class GuiXPSolidifier extends GuiContainer{
|
||||||
this.mc.getTextureManager().bindTexture(resLoc);
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
|
|
||||||
this.drawCenteredString(this.fontRendererObj, Integer.toString(this.solidifier.amount), guiLeft+88, guiTop+30, StringUtil.DECIMAL_COLOR_WHITE);
|
this.drawCenteredString(this.fontRendererObj, Integer.toString(this.solidifier.amount), this.guiLeft+88, this.guiTop+30, StringUtil.DECIMAL_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(this.x, this.y, this.z, this.world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer);
|
this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -102,7 +102,7 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
|
||||||
return new IItemColor(){
|
return new IItemColor(){
|
||||||
@Override
|
@Override
|
||||||
public int getColorFromItemstack(ItemStack stack, int pass){
|
public int getColorFromItemstack(ItemStack stack, int pass){
|
||||||
return pass > 0 ? color : 0xFFFFFF;
|
return pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class ItemLeafBlower extends ItemBase{
|
||||||
@Override
|
@Override
|
||||||
public void onUsingTick(ItemStack stack, EntityLivingBase player, int time){
|
public void onUsingTick(ItemStack stack, EntityLivingBase player, int time){
|
||||||
if(!player.worldObj.isRemote){
|
if(!player.worldObj.isRemote){
|
||||||
if(time <= getMaxItemUseDuration(stack) && (this.isAdvanced || time%3 == 0)){
|
if(time <= this.getMaxItemUseDuration(stack) && (this.isAdvanced || time%3 == 0)){
|
||||||
//Breaks the Blocks
|
//Breaks the Blocks
|
||||||
this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ));
|
this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ));
|
||||||
//Plays a Minecart sounds (It really sounds like a Leaf Blower!)
|
//Plays a Minecart sounds (It really sounds like a Leaf Blower!)
|
||||||
|
|
|
@ -99,8 +99,8 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getDurabilityForDisplay(ItemStack stack){
|
public double getDurabilityForDisplay(ItemStack stack){
|
||||||
double energyDif = getMaxEnergyStored(stack)-getEnergyStored(stack);
|
double energyDif = this.getMaxEnergyStored(stack)-this.getEnergyStored(stack);
|
||||||
double maxAmount = getMaxEnergyStored(stack);
|
double maxAmount = this.getMaxEnergyStored(stack);
|
||||||
return energyDif/maxAmount;
|
return energyDif/maxAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ public class LaserRelayConnectionHandler{
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(BlockPos relay){
|
public boolean contains(BlockPos relay){
|
||||||
return (this.firstRelay != null && PosUtil.areSamePos(firstRelay, relay)) || (this.secondRelay != null && PosUtil.areSamePos(secondRelay, relay));
|
return (this.firstRelay != null && PosUtil.areSamePos(this.firstRelay, relay)) || (this.secondRelay != null && PosUtil.areSamePos(this.secondRelay, relay));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
|
||||||
|
|
||||||
private void doWork(){
|
private void doWork(){
|
||||||
if(this.storage.getEnergyStored() >= ENERGY_USE){
|
if(this.storage.getEnergyStored() >= ENERGY_USE){
|
||||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj));
|
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj));
|
||||||
//Extract energy for shooting the laser itself too!
|
//Extract energy for shooting the laser itself too!
|
||||||
this.storage.extractEnergy(ENERGY_USE, false);
|
this.storage.extractEnergy(ENERGY_USE, false);
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
|
||||||
System.out.println("SOUND!");
|
System.out.println("SOUND!");
|
||||||
this.worldObj.playSound(null, this.getX(), this.getY(), this.getZ(), SoundHandler.reconstructor, SoundCategory.BLOCKS, 0.35F, 1.0F);
|
this.worldObj.playSound(null, this.getX(), this.getY(), this.getZ(), SoundHandler.reconstructor, SoundCategory.BLOCKS, 0.35F, 1.0F);
|
||||||
}
|
}
|
||||||
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getX(), this.getY(), this.getZ(), endX, endY, endZ, currentLens.getColor(), ConfigValues.lessParticles ? 2 : 8, 2F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimension(), this.getX(), this.getY(), this.getZ(), 64));
|
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getX(), this.getY(), this.getZ(), endX, endY, endZ, currentLens.getColor(), ConfigValues.lessParticles ? 2 : 8, 2F), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getX(), this.getY(), this.getZ(), 64));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
||||||
if(this.currentTime > 0){
|
if(this.currentTime > 0){
|
||||||
this.currentTime--;
|
this.currentTime--;
|
||||||
|
@ -76,28 +76,28 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doWork(){
|
private void doWork(){
|
||||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj));
|
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj));
|
||||||
|
|
||||||
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0);
|
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0);
|
||||||
if(coordsBlock != null){
|
if(coordsBlock != null){
|
||||||
Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj);
|
Block blockToBreak = PosUtil.getBlock(coordsBlock, this.worldObj);
|
||||||
IBlockState stateToBreak = worldObj.getBlockState(coordsBlock);
|
IBlockState stateToBreak = this.worldObj.getBlockState(coordsBlock);
|
||||||
if(!this.isPlacer && blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(stateToBreak, worldObj, coordsBlock) > -1.0F){
|
if(!this.isPlacer && blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(stateToBreak, this.worldObj, coordsBlock) > -1.0F){
|
||||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||||
drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, stateToBreak, 0));
|
drops.addAll(blockToBreak.getDrops(this.worldObj, coordsBlock, stateToBreak, 0));
|
||||||
|
|
||||||
if(WorldUtil.addToInventory(this, drops, false, true)){
|
if(WorldUtil.addToInventory(this, drops, false, true)){
|
||||||
if(!ConfigValues.lessBlockBreakingEffects){
|
if(!ConfigValues.lessBlockBreakingEffects){
|
||||||
worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(stateToBreak));
|
this.worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(stateToBreak));
|
||||||
}
|
}
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos);
|
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.pos);
|
||||||
WorldUtil.addToInventory(this, drops, true, true);
|
WorldUtil.addToInventory(this, drops, true, true);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.isPlacer){
|
else if(this.isPlacer){
|
||||||
int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
|
int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
|
||||||
this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, this.slots[theSlot]));
|
this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, this.worldObj, this.pos, this.slots[theSlot]));
|
||||||
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
|
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
|
||||||
this.slots[theSlot] = null;
|
this.slots[theSlot] = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.isCanola(0) && PRODUCE <= this.tank.getCapacity()-this.tank.getFluidAmount()){
|
if(this.isCanola(0) && PRODUCE <= this.tank.getCapacity()-this.tank.getFluidAmount()){
|
||||||
if(this.storage.getEnergyStored() >= ENERGY_USE){
|
if(this.storage.getEnergyStored() >= ENERGY_USE){
|
||||||
this.currentProcessTime++;
|
this.currentProcessTime++;
|
||||||
|
@ -97,15 +97,15 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
|
||||||
this.currentProcessTime = 0;
|
this.currentProcessTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldUtil.fillBucket(tank, slots, 1, 2);
|
WorldUtil.fillBucket(this.tank, this.slots, 1, 2);
|
||||||
|
|
||||||
if(this.tank.getFluidAmount() > 0){
|
if(this.tank.getFluidAmount() > 0){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.DOWN, this.tank);
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.NORTH, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.EAST, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.SOUTH, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.WEST, this.tank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean flag = this.currentBurnTime > 0;
|
boolean flag = this.currentBurnTime > 0;
|
||||||
|
|
||||||
if(this.currentBurnTime > 0){
|
if(this.currentBurnTime > 0){
|
||||||
|
@ -85,19 +85,19 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
|
WorldUtil.pushEnergyToAllSides(this.worldObj, this.pos, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag != this.currentBurnTime > 0){
|
if(flag != this.currentBurnTime > 0){
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = PosUtil.getMetadata(this.getPos(), worldObj);
|
int meta = PosUtil.getMetadata(this.getPos(), this.worldObj);
|
||||||
if(meta == 1){
|
if(meta == 1){
|
||||||
if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored())){
|
if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored())){
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 0, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 1, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
this.storeCoffee();
|
this.storeCoffee();
|
||||||
|
|
||||||
if(this.brewTime > 0 || this.isRedstonePowered){
|
if(this.brewTime > 0 || this.isRedstonePowered){
|
||||||
|
@ -103,7 +103,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
|
|
||||||
if((this.coffeeCacheAmount != this.lastCoffeeAmount || this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.brewTime != this.lastBrewTime) && this.sendUpdateWithInterval()){
|
if((this.coffeeCacheAmount != this.lastCoffeeAmount || this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.brewTime != this.lastBrewTime) && this.sendUpdateWithInterval()){
|
||||||
this.lastCoffeeAmount = coffeeCacheAmount;
|
this.lastCoffeeAmount = this.coffeeCacheAmount;
|
||||||
this.lastEnergy = this.storage.getEnergyStored();
|
this.lastEnergy = this.storage.getEnergyStored();
|
||||||
this.lastTank = this.tank.getFluidAmount();
|
this.lastTank = this.tank.getFluidAmount();
|
||||||
this.lastBrewTime = this.brewTime;
|
this.lastBrewTime = this.brewTime;
|
||||||
|
@ -128,11 +128,11 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldUtil.emptyBucket(tank, slots, SLOT_WATER_INPUT, SLOT_WATER_OUTPUT, FluidRegistry.WATER);
|
WorldUtil.emptyBucket(this.tank, this.slots, SLOT_WATER_INPUT, SLOT_WATER_OUTPUT, FluidRegistry.WATER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void brew(){
|
public void brew(){
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.slots[SLOT_INPUT] != null && this.slots[SLOT_INPUT].getItem() == InitItems.itemMisc && this.slots[SLOT_INPUT].getItemDamage() == TheMiscItems.CUP.ordinal() && this.slots[SLOT_OUTPUT] == null && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){
|
if(this.slots[SLOT_INPUT] != null && this.slots[SLOT_INPUT].getItem() == InitItems.itemMisc && this.slots[SLOT_INPUT].getItemDamage() == TheMiscItems.CUP.ordinal() && this.slots[SLOT_OUTPUT] == null && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){
|
||||||
if(this.storage.getEnergyStored() >= ENERGY_USED){
|
if(this.storage.getEnergyStored() >= ENERGY_USED){
|
||||||
if(this.brewTime%30 == 0 && !ConfigValues.lessSound){
|
if(this.brewTime%30 == 0 && !ConfigValues.lessSound){
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class TileEntityCompost extends TileEntityInventoryBase{
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean theFlag = this.conversionTime > 0;
|
boolean theFlag = this.conversionTime > 0;
|
||||||
if(this.slots[0] != null && !(this.slots[0].getItem() instanceof ItemFertilizer) && this.slots[0].stackSize >= AMOUNT){
|
if(this.slots[0] != null && !(this.slots[0].getItem() instanceof ItemFertilizer) && this.slots[0].stackSize >= AMOUNT){
|
||||||
this.conversionTime++;
|
this.conversionTime++;
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
||||||
if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){
|
if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){
|
||||||
if(this.currentTime > 0){
|
if(this.currentTime > 0){
|
||||||
|
@ -79,21 +79,21 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doWork(){
|
private void doWork(){
|
||||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj));
|
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj));
|
||||||
|
|
||||||
for(int i = 0; i < RANGE; i++){
|
for(int i = 0; i < RANGE; i++){
|
||||||
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, pos, i);
|
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, i);
|
||||||
if(coordsBlock != null){
|
if(coordsBlock != null){
|
||||||
Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj);
|
Block blockToBreak = PosUtil.getBlock(coordsBlock, this.worldObj);
|
||||||
if(blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(worldObj.getBlockState(coordsBlock), worldObj, pos) > -1.0F){
|
if(blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(this.worldObj.getBlockState(coordsBlock), this.worldObj, this.pos) > -1.0F){
|
||||||
ArrayList<ItemStack> drops = new ArrayList();
|
ArrayList<ItemStack> drops = new ArrayList();
|
||||||
drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0));
|
drops.addAll(blockToBreak.getDrops(this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0));
|
||||||
|
|
||||||
if(WorldUtil.addToInventory(this, drops, false, true)){
|
if(WorldUtil.addToInventory(this, drops, false, true)){
|
||||||
if(!ConfigValues.lessBlockBreakingEffects){
|
if(!ConfigValues.lessBlockBreakingEffects){
|
||||||
worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(worldObj.getBlockState(coordsBlock)));
|
this.worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(this.worldObj.getBlockState(coordsBlock)));
|
||||||
}
|
}
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.getPos(), i);
|
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.getPos(), i);
|
||||||
WorldUtil.addToInventory(this, drops, true, true);
|
WorldUtil.addToInventory(this, drops, true, true);
|
||||||
this.storage.extractEnergy(ENERGY_USE, false);
|
this.storage.extractEnergy(ENERGY_USE, false);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
||||||
if(this.currentTime > 0){
|
if(this.currentTime > 0){
|
||||||
this.currentTime--;
|
this.currentTime--;
|
||||||
|
@ -65,7 +65,7 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst
|
||||||
if(this.removeFromInventory(false) != null){
|
if(this.removeFromInventory(false) != null){
|
||||||
ItemStack stack = this.removeFromInventory(true);
|
ItemStack stack = this.removeFromInventory(true);
|
||||||
stack.stackSize = 1;
|
stack.stackSize = 1;
|
||||||
WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)), worldObj, this.pos, stack);
|
WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj)), this.worldObj, this.pos, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
int received = ((IEnergyContainerItem)this.slots[0].getItem()).receiveEnergy(this.slots[0], this.storage.getEnergyStored(), false);
|
int received = ((IEnergyContainerItem)this.slots[0].getItem()).receiveEnergy(this.slots[0], this.storage.getEnergyStored(), false);
|
||||||
|
@ -59,7 +59,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
if(this.lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
||||||
this.lastEnergy = this.storage.getEnergyStored();
|
this.lastEnergy = this.storage.getEnergyStored();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){
|
||||||
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) > 0){
|
if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) > 0){
|
||||||
int toReceive = ((IEnergyContainerItem)this.slots[0].getItem()).extractEnergy(this.slots[0], this.storage.getMaxEnergyStored()-this.storage.getEnergyStored(), false);
|
int toReceive = ((IEnergyContainerItem)this.slots[0].getItem()).extractEnergy(this.slots[0], this.storage.getMaxEnergyStored()-this.storage.getEnergyStored(), false);
|
||||||
|
@ -61,10 +61,10 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
|
WorldUtil.pushEnergyToAllSides(this.worldObj, this.pos, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
if(this.lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
||||||
this.lastEnergy = this.storage.getEnergyStored();
|
this.lastEnergy = this.storage.getEnergyStored();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,10 +62,10 @@ public class TileEntityFeeder extends TileEntityInventoryBase{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean theFlag = this.currentTimer > 0;
|
boolean theFlag = this.currentTimer > 0;
|
||||||
int range = 5;
|
int range = 5;
|
||||||
List<EntityAnimal> animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range));
|
List<EntityAnimal> animals = this.worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range));
|
||||||
if(animals != null){
|
if(animals != null){
|
||||||
this.currentAnimalAmount = animals.size();
|
this.currentAnimalAmount = animals.size();
|
||||||
if(this.currentAnimalAmount >= 2){
|
if(this.currentAnimalAmount >= 2){
|
||||||
|
@ -120,7 +120,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase{
|
||||||
double d = Util.RANDOM.nextGaussian()*0.02D;
|
double d = Util.RANDOM.nextGaussian()*0.02D;
|
||||||
double d1 = Util.RANDOM.nextGaussian()*0.02D;
|
double d1 = Util.RANDOM.nextGaussian()*0.02D;
|
||||||
double d2 = Util.RANDOM.nextGaussian()*0.02D;
|
double d2 = Util.RANDOM.nextGaussian()*0.02D;
|
||||||
worldObj.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(Util.RANDOM.nextFloat()*animal.height), (animal.posZ+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2);
|
this.worldObj.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(Util.RANDOM.nextFloat()*animal.height), (animal.posZ+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
int produce = 80;
|
int produce = 80;
|
||||||
if(this.canolaTank.getFluidAmount() >= produce && produce <= this.oilTank.getCapacity()-this.oilTank.getFluidAmount()){
|
if(this.canolaTank.getFluidAmount() >= produce && produce <= this.oilTank.getCapacity()-this.oilTank.getFluidAmount()){
|
||||||
this.currentProcessTime++;
|
this.currentProcessTime++;
|
||||||
|
@ -72,16 +72,16 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
|
||||||
this.currentProcessTime = 0;
|
this.currentProcessTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitFluids.fluidCanolaOil);
|
WorldUtil.emptyBucket(this.canolaTank, this.slots, 0, 1, InitFluids.fluidCanolaOil);
|
||||||
WorldUtil.fillBucket(oilTank, slots, 2, 3);
|
WorldUtil.fillBucket(this.oilTank, this.slots, 2, 3);
|
||||||
|
|
||||||
if(this.oilTank.getFluidAmount() > 0){
|
if(this.oilTank.getFluidAmount() > 0){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.oilTank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.DOWN, this.oilTank);
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.oilTank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.NORTH, this.oilTank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.oilTank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.EAST, this.oilTank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.oilTank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.SOUTH, this.oilTank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.oilTank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.WEST, this.oilTank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,25 +47,25 @@ public class TileEntityFishingNet extends TileEntityBase{
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
if(PosUtil.getMaterial(PosUtil.offset(this.pos, 0, -1, 0), this.worldObj) == Material.WATER){
|
if(PosUtil.getMaterial(PosUtil.offset(this.pos, 0, -1, 0), this.worldObj) == Material.WATER){
|
||||||
if(this.timeUntilNextDrop > 0){
|
if(this.timeUntilNextDrop > 0){
|
||||||
this.timeUntilNextDrop--;
|
this.timeUntilNextDrop--;
|
||||||
if(timeUntilNextDrop <= 0){
|
if(this.timeUntilNextDrop <= 0){
|
||||||
LootContext.Builder builder = new LootContext.Builder((WorldServer)this.worldObj);
|
LootContext.Builder builder = new LootContext.Builder((WorldServer)this.worldObj);
|
||||||
List<ItemStack> fishables = this.worldObj.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(Util.RANDOM, builder.build());
|
List<ItemStack> fishables = this.worldObj.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(Util.RANDOM, builder.build());
|
||||||
for(ItemStack fishable : fishables){
|
for(ItemStack fishable : fishables){
|
||||||
TileEntity tile = worldObj.getTileEntity(PosUtil.offset(pos, 0, 1, 0));
|
TileEntity tile = this.worldObj.getTileEntity(PosUtil.offset(this.pos, 0, 1, 0));
|
||||||
if(tile != null && tile instanceof IInventory){
|
if(tile != null && tile instanceof IInventory){
|
||||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
list.add(fishable);
|
list.add(fishable);
|
||||||
WorldUtil.addToInventory((IInventory)tile, list, EnumFacing.DOWN, true, false);
|
WorldUtil.addToInventory((IInventory)tile, list, EnumFacing.DOWN, true, false);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
EntityItem item = new EntityItem(worldObj, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, fishable);
|
EntityItem item = new EntityItem(this.worldObj, this.pos.getX()+0.5, this.pos.getY()+0.5, this.pos.getZ()+0.5, fishable);
|
||||||
item.lifespan = 2000;
|
item.lifespan = 2000;
|
||||||
worldObj.spawnEntityInWorld(item);
|
this.worldObj.spawnEntityInWorld(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,35 +56,35 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doWork(){
|
private void doWork(){
|
||||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj));
|
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj));
|
||||||
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0);
|
BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0);
|
||||||
|
|
||||||
if(coordsBlock != null){
|
if(coordsBlock != null){
|
||||||
Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj);
|
Block blockToBreak = PosUtil.getBlock(coordsBlock, this.worldObj);
|
||||||
if(!this.isPlacer && blockToBreak != null && PosUtil.getMetadata(coordsBlock, worldObj) == 0 && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount()){
|
if(!this.isPlacer && blockToBreak != null && PosUtil.getMetadata(coordsBlock, this.worldObj) == 0 && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount()){
|
||||||
if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){
|
if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){
|
||||||
if(this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
if(this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
||||||
this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), true);
|
this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), true);
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos);
|
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(blockToBreak == Blocks.LAVA || blockToBreak == Blocks.FLOWING_LAVA){
|
else if(blockToBreak == Blocks.LAVA || blockToBreak == Blocks.FLOWING_LAVA){
|
||||||
if(this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
if(this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
||||||
this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), true);
|
this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), true);
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos);
|
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(blockToBreak == Blocks.WATER || blockToBreak == Blocks.FLOWING_WATER){
|
else if(blockToBreak == Blocks.WATER || blockToBreak == Blocks.FLOWING_WATER){
|
||||||
if(this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
if(this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
||||||
this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true);
|
this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true);
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos);
|
WorldUtil.breakBlockAtSide(sideToManipulate, this.worldObj, this.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.isPlacer && PosUtil.getBlock(coordsBlock, worldObj).isReplaceable(worldObj, coordsBlock)){
|
else if(this.isPlacer && PosUtil.getBlock(coordsBlock, this.worldObj).isReplaceable(this.worldObj, coordsBlock)){
|
||||||
if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){
|
if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){
|
||||||
if(this.tank.getFluid().getFluid().getBlock() != null){
|
if(this.tank.getFluid().getFluid().getBlock() != null){
|
||||||
WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, new ItemStack(this.tank.getFluid().getFluid().getBlock()));
|
WorldUtil.useItemAtSide(sideToManipulate, this.worldObj, this.pos, new ItemStack(this.tank.getFluid().getFluid().getBlock()));
|
||||||
this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true);
|
this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
if(!this.isRedstonePowered && !this.activateOnceWithSignal){
|
||||||
if(this.currentTime > 0){
|
if(this.currentTime > 0){
|
||||||
this.currentTime--;
|
this.currentTime--;
|
||||||
|
@ -163,24 +163,24 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.isPlacer){
|
if(!this.isPlacer){
|
||||||
WorldUtil.fillBucket(tank, slots, 0, 1);
|
WorldUtil.fillBucket(this.tank, this.slots, 0, 1);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
WorldUtil.emptyBucket(tank, slots, 0, 1);
|
WorldUtil.emptyBucket(this.tank, this.slots, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.isPlacer && this.tank.getFluidAmount() > 0){
|
if(!this.isPlacer && this.tank.getFluidAmount() > 0){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.DOWN, this.tank);
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.NORTH, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.EAST, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.SOUTH, this.tank);
|
||||||
WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.tank);
|
WorldUtil.pushFluid(this.worldObj, this.pos, EnumFacing.WEST, this.tank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lastTankAmount != this.tank.getFluidAmount() && this.sendUpdateWithInterval()){
|
if(this.lastTankAmount != this.tank.getFluidAmount() && this.sendUpdateWithInterval()){
|
||||||
lastTankAmount = this.tank.getFluidAmount();
|
this.lastTankAmount = this.tank.getFluidAmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean flag = this.firstSmeltTime > 0 || this.secondSmeltTime > 0;
|
boolean flag = this.firstSmeltTime > 0 || this.secondSmeltTime > 0;
|
||||||
|
|
||||||
boolean canSmeltOnFirst = this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1);
|
boolean canSmeltOnFirst = this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1);
|
||||||
|
@ -97,18 +97,18 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
||||||
|
|
||||||
if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){
|
if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = PosUtil.getMetadata(this.pos, worldObj);
|
int meta = PosUtil.getMetadata(this.pos, this.worldObj);
|
||||||
if(meta > 3){
|
if(meta > 3){
|
||||||
if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)){
|
if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)){
|
||||||
PosUtil.setMetadata(this.pos, worldObj, meta-4, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, meta-4, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
PosUtil.setMetadata(this.pos, worldObj, meta+4, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, meta+4, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime) && this.sendUpdateWithInterval()){
|
if((this.lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime) && this.sendUpdateWithInterval()){
|
||||||
this.lastEnergy = this.storage.getEnergyStored();
|
this.lastEnergy = this.storage.getEnergyStored();
|
||||||
this.lastFirstSmelt = this.firstSmeltTime;
|
this.lastFirstSmelt = this.firstSmeltTime;
|
||||||
this.lastSecondSmelt = this.secondSmeltTime;
|
this.lastSecondSmelt = this.secondSmeltTime;
|
||||||
|
|
|
@ -61,8 +61,8 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.hasBlockAbove() && worldObj.isDaytime()){
|
if(!this.hasBlockAbove() && this.worldObj.isDaytime()){
|
||||||
if(PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){
|
if(PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){
|
||||||
this.storage.receiveEnergy(PRODUCE, false);
|
this.storage.receiveEnergy(PRODUCE, false);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
|
@ -70,7 +70,7 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
|
WorldUtil.pushEnergyToAllSides(this.worldObj, this.pos, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
||||||
|
@ -80,9 +80,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasBlockAbove(){
|
public boolean hasBlockAbove(){
|
||||||
for(int y = 1; y <= worldObj.getHeight(); y++){
|
for(int y = 1; y <= this.worldObj.getHeight(); y++){
|
||||||
BlockPos offset = PosUtil.offset(this.pos, 0, y, 0);
|
BlockPos offset = PosUtil.offset(this.pos, 0, y, 0);
|
||||||
if(!PosUtil.getBlock(offset, worldObj).isAir(worldObj.getBlockState(offset), worldObj, offset)){
|
if(!PosUtil.getBlock(offset, this.worldObj).isAir(this.worldObj.getBlockState(offset), this.worldObj, offset)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,18 +39,18 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(worldObj.canBlockSeeSky(this.getPos()) && worldObj.isDaytime()){
|
if(this.worldObj.canBlockSeeSky(this.getPos()) && this.worldObj.isDaytime()){
|
||||||
if(this.timeUntilNextFert > 0){
|
if(this.timeUntilNextFert > 0){
|
||||||
this.timeUntilNextFert--;
|
this.timeUntilNextFert--;
|
||||||
if(timeUntilNextFert <= 0){
|
if(this.timeUntilNextFert <= 0){
|
||||||
BlockPos blockToFert = this.blockToFertilize();
|
BlockPos blockToFert = this.blockToFertilize();
|
||||||
if(blockToFert != null){
|
if(blockToFert != null){
|
||||||
int metaBefore = PosUtil.getMetadata(blockToFert, worldObj);
|
int metaBefore = PosUtil.getMetadata(blockToFert, this.worldObj);
|
||||||
PosUtil.getBlock(blockToFert, worldObj).updateTick(worldObj, blockToFert, worldObj.getBlockState(blockToFert), Util.RANDOM);
|
PosUtil.getBlock(blockToFert, this.worldObj).updateTick(this.worldObj, blockToFert, this.worldObj.getBlockState(blockToFert), Util.RANDOM);
|
||||||
|
|
||||||
if(PosUtil.getMetadata(blockToFert, worldObj) != metaBefore){
|
if(PosUtil.getMetadata(blockToFert, this.worldObj) != metaBefore){
|
||||||
worldObj.playAuxSFX(2005, blockToFert, 0);
|
this.worldObj.playAuxSFX(2005, blockToFert, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,8 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
|
||||||
public BlockPos blockToFertilize(){
|
public BlockPos blockToFertilize(){
|
||||||
for(int i = -1; i > 0; i--){
|
for(int i = -1; i > 0; i--){
|
||||||
BlockPos offset = PosUtil.offset(this.pos, 0, i, 0);
|
BlockPos offset = PosUtil.offset(this.pos, 0, i, 0);
|
||||||
Block block = PosUtil.getBlock(pos, worldObj);
|
Block block = PosUtil.getBlock(this.pos, this.worldObj);
|
||||||
if(block != null && !(worldObj.isAirBlock(offset))){
|
if(block != null && !(this.worldObj.isAirBlock(offset))){
|
||||||
if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){
|
if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean flag = this.firstCrushTime > 0 || this.secondCrushTime > 0;
|
boolean flag = this.firstCrushTime > 0 || this.secondCrushTime > 0;
|
||||||
|
|
||||||
boolean canCrushOnFirst = this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
|
boolean canCrushOnFirst = this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
|
||||||
|
@ -113,7 +113,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
||||||
shouldPlaySound = true;
|
shouldPlaySound = true;
|
||||||
}
|
}
|
||||||
this.firstCrushTime++;
|
this.firstCrushTime++;
|
||||||
if(this.firstCrushTime >= getMaxCrushTime()){
|
if(this.firstCrushTime >= this.getMaxCrushTime()){
|
||||||
this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
|
this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
|
||||||
this.firstCrushTime = 0;
|
this.firstCrushTime = 0;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
||||||
shouldPlaySound = true;
|
shouldPlaySound = true;
|
||||||
}
|
}
|
||||||
this.secondCrushTime++;
|
this.secondCrushTime++;
|
||||||
if(this.secondCrushTime >= getMaxCrushTime()){
|
if(this.secondCrushTime >= this.getMaxCrushTime()){
|
||||||
this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
|
this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
|
||||||
this.secondCrushTime = 0;
|
this.secondCrushTime = 0;
|
||||||
}
|
}
|
||||||
|
@ -147,18 +147,18 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
||||||
|
|
||||||
if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){
|
if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = PosUtil.getMetadata(this.pos, worldObj);
|
int meta = PosUtil.getMetadata(this.pos, this.worldObj);
|
||||||
if(meta == 1){
|
if(meta == 1){
|
||||||
if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))){
|
if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))){
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 0, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 1, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime) && this.sendUpdateWithInterval()){
|
if((this.lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime) && this.sendUpdateWithInterval()){
|
||||||
this.lastEnergy = this.storage.getEnergyStored();
|
this.lastEnergy = this.storage.getEnergyStored();
|
||||||
this.lastFirstCrush = this.firstCrushTime;
|
this.lastFirstCrush = this.firstCrushTime;
|
||||||
this.lastSecondCrush = this.secondCrushTime;
|
this.lastSecondCrush = this.secondCrushTime;
|
||||||
|
|
|
@ -47,13 +47,13 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
ArrayList<Integer> blocksAround = new ArrayList<Integer>();
|
ArrayList<Integer> blocksAround = new ArrayList<Integer>();
|
||||||
if(ENERGY_PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){
|
if(ENERGY_PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){
|
||||||
for(int i = 1; i <= 5; i++){
|
for(int i = 1; i <= 5; i++){
|
||||||
BlockPos coords = WorldUtil.getCoordsFromSide(WorldUtil.getDirectionBySidesInOrder(i), this.pos, 0);
|
BlockPos coords = WorldUtil.getCoordsFromSide(WorldUtil.getDirectionBySidesInOrder(i), this.pos, 0);
|
||||||
Block block = PosUtil.getBlock(coords, worldObj);
|
Block block = PosUtil.getBlock(coords, this.worldObj);
|
||||||
if(block != null && block.getMaterial(worldObj.getBlockState(coords)) == Material.LAVA && PosUtil.getMetadata(coords, worldObj) == 0){
|
if(block != null && block.getMaterial(this.worldObj.getBlockState(coords)) == Material.LAVA && PosUtil.getMetadata(coords, this.worldObj) == 0){
|
||||||
blocksAround.add(i);
|
blocksAround.add(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,13 +64,13 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
|
||||||
|
|
||||||
if(Util.RANDOM.nextInt(10000) == 0){
|
if(Util.RANDOM.nextInt(10000) == 0){
|
||||||
int randomSide = blocksAround.get(Util.RANDOM.nextInt(blocksAround.size()));
|
int randomSide = blocksAround.get(Util.RANDOM.nextInt(blocksAround.size()));
|
||||||
WorldUtil.breakBlockAtSide(WorldUtil.getDirectionBySidesInOrder(randomSide), worldObj, this.pos);
|
WorldUtil.breakBlockAtSide(WorldUtil.getDirectionBySidesInOrder(randomSide), this.worldObj, this.pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergy(worldObj, this.pos, EnumFacing.UP, this.storage);
|
WorldUtil.pushEnergy(this.worldObj, this.pos, EnumFacing.UP, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
*/
|
*/
|
||||||
private void pull(){
|
private void pull(){
|
||||||
//The Inventory to pull from
|
//The Inventory to pull from
|
||||||
IInventory theInventory = (IInventory)placeToPull;
|
IInventory theInventory = (IInventory)this.placeToPull;
|
||||||
//Does the Inventory even have Slots!?
|
//Does the Inventory even have Slots!?
|
||||||
if(theInventory.getSizeInventory() > 0){
|
if(theInventory.getSizeInventory() > 0){
|
||||||
//The slot currently pulling from (for later)
|
//The slot currently pulling from (for later)
|
||||||
|
@ -181,7 +181,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
* (Check pull() for Description, similar to this)
|
* (Check pull() for Description, similar to this)
|
||||||
*/
|
*/
|
||||||
private void put(){
|
private void put(){
|
||||||
IInventory theInventory = (IInventory)placeToPut;
|
IInventory theInventory = (IInventory)this.placeToPut;
|
||||||
if(theInventory.getSizeInventory() > 0){
|
if(theInventory.getSizeInventory() > 0){
|
||||||
int theSlotToPut = this.slotToPutStart;
|
int theSlotToPut = this.slotToPutStart;
|
||||||
int maxSize = theInventory.getInventoryStackLimit();
|
int maxSize = theInventory.getInventoryStackLimit();
|
||||||
|
@ -266,7 +266,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
* @return If the Item is filtered correctly
|
* @return If the Item is filtered correctly
|
||||||
*/
|
*/
|
||||||
private boolean checkBothFilters(ItemStack stack){
|
private boolean checkBothFilters(ItemStack stack){
|
||||||
return this.checkFilter(stack, true, isPullWhitelist) || this.checkFilter(stack, false, isPutWhitelist);
|
return this.checkFilter(stack, true, this.isPullWhitelist) || this.checkFilter(stack, false, this.isPutWhitelist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -395,23 +395,23 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
this.initVars();
|
this.initVars();
|
||||||
|
|
||||||
//Is Block not powered by Redstone?
|
//Is Block not powered by Redstone?
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
if(!(this.sideToPull == this.sideToPut && this.slotToPullStart == this.slotToPutStart && this.slotToPullEnd == this.slotToPutEnd)){
|
if(!(this.sideToPull == this.sideToPut && this.slotToPullStart == this.slotToPutStart && this.slotToPullEnd == this.slotToPutEnd)){
|
||||||
if(sideToPull != -1 && this.placeToPull instanceof IInventory){
|
if(this.sideToPull != -1 && this.placeToPull instanceof IInventory){
|
||||||
this.pull();
|
this.pull();
|
||||||
}
|
}
|
||||||
if(sideToPut != -1 && this.placeToPut instanceof IInventory){
|
if(this.sideToPut != -1 && this.placeToPut instanceof IInventory){
|
||||||
this.put();
|
this.put();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the Client
|
//Update the Client
|
||||||
if((this.sideToPut != this.lastPutSide || this.sideToPull != this.lastPullSide || this.slotToPullStart != this.lastPullStart || this.slotToPullEnd != this.lastPullEnd || this.slotToPutStart != this.lastPutStart || this.slotToPutEnd != this.lastPutEnd || this.isPullWhitelist != lastPullWhite || this.isPutWhitelist != this.lastPutWhite) && this.sendUpdateWithInterval()){
|
if((this.sideToPut != this.lastPutSide || this.sideToPull != this.lastPullSide || this.slotToPullStart != this.lastPullStart || this.slotToPullEnd != this.lastPullEnd || this.slotToPutStart != this.lastPutStart || this.slotToPutEnd != this.lastPutEnd || this.isPullWhitelist != this.lastPullWhite || this.isPutWhitelist != this.lastPutWhite) && this.sendUpdateWithInterval()){
|
||||||
this.lastPutSide = this.sideToPut;
|
this.lastPutSide = this.sideToPut;
|
||||||
this.lastPullSide = this.sideToPull;
|
this.lastPullSide = this.sideToPull;
|
||||||
this.lastPullStart = this.slotToPullStart;
|
this.lastPullStart = this.slotToPullStart;
|
||||||
|
|
|
@ -41,11 +41,11 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
||||||
if(!isForSync || this.shouldSyncSlots()){
|
if(!isForSync || this.shouldSyncSlots()){
|
||||||
if(this.slots.length > 0){
|
if(this.slots.length > 0){
|
||||||
NBTTagList tagList = new NBTTagList();
|
NBTTagList tagList = new NBTTagList();
|
||||||
for(int currentIndex = 0; currentIndex < slots.length; currentIndex++){
|
for(int currentIndex = 0; currentIndex < this.slots.length; currentIndex++){
|
||||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||||
tagCompound.setByte("Slot", (byte)currentIndex);
|
tagCompound.setByte("Slot", (byte)currentIndex);
|
||||||
if(slots[currentIndex] != null){
|
if(this.slots[currentIndex] != null){
|
||||||
slots[currentIndex].writeToNBT(tagCompound);
|
this.slots[currentIndex].writeToNBT(tagCompound);
|
||||||
}
|
}
|
||||||
tagList.appendTag(tagCompound);
|
tagList.appendTag(tagCompound);
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
||||||
for(int i = 0; i < tagList.tagCount(); i++){
|
for(int i = 0; i < tagList.tagCount(); i++){
|
||||||
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
|
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
|
||||||
byte slotIndex = tagCompound.getByte("Slot");
|
byte slotIndex = tagCompound.getByte("Slot");
|
||||||
if(slotIndex >= 0 && slotIndex < slots.length){
|
if(slotIndex >= 0 && slotIndex < this.slots.length){
|
||||||
slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
|
this.slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
||||||
@Override
|
@Override
|
||||||
public int[] getSlotsForFace(EnumFacing side){
|
public int[] getSlotsForFace(EnumFacing side){
|
||||||
if(this.slots.length > 0){
|
if(this.slots.length > 0){
|
||||||
int[] theInt = new int[slots.length];
|
int[] theInt = new int[this.slots.length];
|
||||||
for(int i = 0; i < theInt.length; i++){
|
for(int i = 0; i < theInt.length; i++){
|
||||||
theInt[i] = i;
|
theInt[i] = i;
|
||||||
}
|
}
|
||||||
|
@ -148,31 +148,31 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory(){
|
public int getSizeInventory(){
|
||||||
return slots.length;
|
return this.slots.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getStackInSlot(int i){
|
public ItemStack getStackInSlot(int i){
|
||||||
if(i < this.getSizeInventory()){
|
if(i < this.getSizeInventory()){
|
||||||
return slots[i];
|
return this.slots[i];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack decrStackSize(int i, int j){
|
public ItemStack decrStackSize(int i, int j){
|
||||||
if(slots[i] != null){
|
if(this.slots[i] != null){
|
||||||
ItemStack stackAt;
|
ItemStack stackAt;
|
||||||
if(slots[i].stackSize <= j){
|
if(this.slots[i].stackSize <= j){
|
||||||
stackAt = slots[i];
|
stackAt = this.slots[i];
|
||||||
slots[i] = null;
|
this.slots[i] = null;
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
return stackAt;
|
return stackAt;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
stackAt = slots[i].splitStack(j);
|
stackAt = this.slots[i].splitStack(j);
|
||||||
if(slots[i].stackSize == 0){
|
if(this.slots[i].stackSize == 0){
|
||||||
slots[i] = null;
|
this.slots[i] = null;
|
||||||
}
|
}
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
return stackAt;
|
return stackAt;
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.slots[SLOT_OUTPUT] == null && canBeRepaired(this.slots[SLOT_INPUT])){
|
if(this.slots[SLOT_OUTPUT] == null && canBeRepaired(this.slots[SLOT_INPUT])){
|
||||||
if(this.slots[SLOT_INPUT].getItemDamage() <= 0){
|
if(this.slots[SLOT_INPUT].getItemDamage() <= 0){
|
||||||
this.slots[SLOT_OUTPUT] = this.slots[SLOT_INPUT].copy();
|
this.slots[SLOT_OUTPUT] = this.slots[SLOT_INPUT].copy();
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei
|
||||||
if(maxTransmit > 0){
|
if(maxTransmit > 0){
|
||||||
LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(this.pos);
|
LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(this.pos);
|
||||||
if(network != null){
|
if(network != null){
|
||||||
transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(worldObj, blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate);
|
transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(this.worldObj, blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return transmitted;
|
return transmitted;
|
||||||
|
|
|
@ -51,12 +51,12 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.storage.getEnergyStored() >= ENERGY_USE && this.isMultiblock() == HAS_AIR){
|
if(this.storage.getEnergyStored() >= ENERGY_USE && this.isMultiblock() == HAS_AIR){
|
||||||
this.currentWorkTime++;
|
this.currentWorkTime++;
|
||||||
if(this.currentWorkTime >= 200){
|
if(this.currentWorkTime >= 200){
|
||||||
this.currentWorkTime = 0;
|
this.currentWorkTime = 0;
|
||||||
PosUtil.setBlock(PosUtil.offset(this.pos, 0, 1, 0), worldObj, Blocks.LAVA, 0, 2);
|
PosUtil.setBlock(PosUtil.offset(this.pos, 0, 1, 0), this.worldObj, Blocks.LAVA, 0, 2);
|
||||||
this.storage.extractEnergy(ENERGY_USE, false);
|
this.storage.extractEnergy(ENERGY_USE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,12 +79,12 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
||||||
PosUtil.offset(thisPos, 0, 1, -1)
|
PosUtil.offset(thisPos, 0, 1, -1)
|
||||||
};
|
};
|
||||||
|
|
||||||
if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), worldObj)){
|
if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), this.worldObj)){
|
||||||
BlockPos pos = PosUtil.offset(thisPos, 0, 1, 0);
|
BlockPos pos = PosUtil.offset(thisPos, 0, 1, 0);
|
||||||
if(PosUtil.getBlock(pos, worldObj) == Blocks.LAVA || PosUtil.getBlock(pos, worldObj) == Blocks.FLOWING_LAVA){
|
if(PosUtil.getBlock(pos, this.worldObj) == Blocks.LAVA || PosUtil.getBlock(pos, this.worldObj) == Blocks.FLOWING_LAVA){
|
||||||
return HAS_LAVA;
|
return HAS_LAVA;
|
||||||
}
|
}
|
||||||
if(PosUtil.getBlock(pos, worldObj) == null || worldObj.isAirBlock(pos)){
|
if(PosUtil.getBlock(pos, this.worldObj) == null || this.worldObj.isAirBlock(pos)){
|
||||||
return HAS_AIR;
|
return HAS_AIR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
|
|
||||||
if(this.nextUseCounter >= 5){
|
if(this.nextUseCounter >= 5){
|
||||||
|
@ -66,7 +66,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
for(int reachZ = -RANGE; reachZ < RANGE+1; reachZ++){
|
for(int reachZ = -RANGE; reachZ < RANGE+1; reachZ++){
|
||||||
for(int reachY = -RANGE; reachY < RANGE+1; reachY++){
|
for(int reachY = -RANGE; reachY < RANGE+1; reachY++){
|
||||||
BlockPos pos = PosUtil.offset(this.pos, reachX, reachY, reachZ);
|
BlockPos pos = PosUtil.offset(this.pos, reachX, reachY, reachZ);
|
||||||
Block block = PosUtil.getBlock(pos, worldObj);
|
Block block = PosUtil.getBlock(pos, this.worldObj);
|
||||||
if(block != null && block.isLeaves(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
if(block != null && block.isLeaves(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
||||||
breakPositions.add(pos);
|
breakPositions.add(pos);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
BlockPos theCoord = breakPositions.get(0);
|
BlockPos theCoord = breakPositions.get(0);
|
||||||
|
|
||||||
if(!ConfigValues.lessBlockBreakingEffects){
|
if(!ConfigValues.lessBlockBreakingEffects){
|
||||||
this.worldObj.playAuxSFX(2001, theCoord, Block.getStateId(worldObj.getBlockState(theCoord)));
|
this.worldObj.playAuxSFX(2001, theCoord, Block.getStateId(this.worldObj.getBlockState(theCoord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.worldObj.setBlockToAir(theCoord);
|
this.worldObj.setBlockToAir(theCoord);
|
||||||
|
@ -87,7 +87,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
this.storage.receiveEnergy(ENERGY_PRODUCED, false);
|
this.storage.receiveEnergy(ENERGY_PRODUCED, false);
|
||||||
|
|
||||||
if(!ConfigValues.lessParticles){
|
if(!ConfigValues.lessParticles){
|
||||||
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimension(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 64));
|
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 64));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
|
WorldUtil.pushEnergyToAllSides(this.worldObj, this.pos, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
||||||
if(!this.isRedstonePowered && this.ticksElapsed%5 == 0){
|
if(!this.isRedstonePowered && this.ticksElapsed%5 == 0){
|
||||||
|
|
||||||
if(this.layerAt > 0){
|
if(this.layerAt > 0){
|
||||||
if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, worldObj, this.pos))){
|
if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.worldObj, this.pos))){
|
||||||
this.layerAt--;
|
this.layerAt--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,18 +94,18 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
||||||
if(this.storage.getEnergyStored() >= actualUse){
|
if(this.storage.getEnergyStored() >= actualUse){
|
||||||
BlockPos pos = new BlockPos(this.pos.getX()+anX, this.layerAt, this.pos.getZ()+aZ);
|
BlockPos pos = new BlockPos(this.pos.getX()+anX, this.layerAt, this.pos.getZ()+aZ);
|
||||||
|
|
||||||
Block block = PosUtil.getBlock(pos, worldObj);
|
Block block = PosUtil.getBlock(pos, this.worldObj);
|
||||||
int meta = PosUtil.getMetadata(pos, worldObj);
|
int meta = PosUtil.getMetadata(pos, this.worldObj);
|
||||||
if(block != null && !block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
if(block != null && !block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
||||||
if(block.getHarvestLevel(worldObj.getBlockState(pos)) <= 3F && block.getBlockHardness(this.worldObj.getBlockState(pos), this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){
|
if(block.getHarvestLevel(this.worldObj.getBlockState(pos)) <= 3F && block.getBlockHardness(this.worldObj.getBlockState(pos), this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){
|
||||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||||
drops.addAll(block.getDrops(worldObj, pos, worldObj.getBlockState(pos), 0));
|
drops.addAll(block.getDrops(this.worldObj, pos, this.worldObj.getBlockState(pos), 0));
|
||||||
|
|
||||||
if(WorldUtil.addToInventory(this, drops, false, true)){
|
if(WorldUtil.addToInventory(this, drops, false, true)){
|
||||||
if(!ConfigValues.lessBlockBreakingEffects){
|
if(!ConfigValues.lessBlockBreakingEffects){
|
||||||
worldObj.playAuxSFX(2001, pos, Block.getStateId(worldObj.getBlockState(pos)));
|
this.worldObj.playAuxSFX(2001, pos, Block.getStateId(this.worldObj.getBlockState(pos)));
|
||||||
}
|
}
|
||||||
worldObj.setBlockToAir(pos);
|
this.worldObj.setBlockToAir(pos);
|
||||||
|
|
||||||
WorldUtil.addToInventory(this, drops, true, true);
|
WorldUtil.addToInventory(this, drops, true, true);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
|
@ -157,7 +157,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
||||||
|
|
||||||
private void shootParticles(int endX, int endY, int endZ){
|
private void shootParticles(int endX, int endY, int endZ){
|
||||||
if(!ConfigValues.lessParticles){
|
if(!ConfigValues.lessParticles){
|
||||||
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96));
|
PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
boolean flag = this.currentBurnTime > 0;
|
boolean flag = this.currentBurnTime > 0;
|
||||||
|
|
||||||
if(this.currentBurnTime > 0){
|
if(this.currentBurnTime > 0){
|
||||||
|
@ -88,22 +88,22 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldUtil.emptyBucket(tank, slots, 0, 1, InitFluids.fluidOil);
|
WorldUtil.emptyBucket(this.tank, this.slots, 0, 1, InitFluids.fluidOil);
|
||||||
|
|
||||||
if(this.storage.getEnergyStored() > 0){
|
if(this.storage.getEnergyStored() > 0){
|
||||||
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
|
WorldUtil.pushEnergyToAllSides(this.worldObj, this.pos, this.storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag != this.currentBurnTime > 0){
|
if(flag != this.currentBurnTime > 0){
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
int meta = PosUtil.getMetadata(pos, worldObj);
|
int meta = PosUtil.getMetadata(this.pos, this.worldObj);
|
||||||
if(meta == 1){
|
if(meta == 1){
|
||||||
if(!(ENERGY_PRODUCED*BURN_TIME <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored() && this.currentBurnTime <= 0 && this.tank.getFluidAmount() >= fuelUsed)){
|
if(!(ENERGY_PRODUCED*BURN_TIME <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored() && this.currentBurnTime <= 0 && this.tank.getFluidAmount() >= fuelUsed)){
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 0, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 0, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
PosUtil.setMetadata(this.pos, worldObj, 1, 2);
|
PosUtil.setMetadata(this.pos, this.worldObj, 1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement
|
||||||
|
|
||||||
public IEnergyProvider getProvider(){
|
public IEnergyProvider getProvider(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
TileEntity tile = worldObj.getTileEntity(boundPosition);
|
TileEntity tile = this.worldObj.getTileEntity(this.boundPosition);
|
||||||
if(tile instanceof IEnergyProvider){
|
if(tile instanceof IEnergyProvider){
|
||||||
return (IEnergyProvider)tile;
|
return (IEnergyProvider)tile;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement
|
||||||
|
|
||||||
public IEnergyReceiver getReceiver(){
|
public IEnergyReceiver getReceiver(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
TileEntity tile = worldObj.getTileEntity(boundPosition);
|
TileEntity tile = this.worldObj.getTileEntity(this.boundPosition);
|
||||||
if(tile instanceof IEnergyReceiver){
|
if(tile instanceof IEnergyReceiver){
|
||||||
return (IEnergyReceiver)tile;
|
return (IEnergyReceiver)tile;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.isBoundThingInRange() && this.getProvider() != null){
|
if(this.isBoundThingInRange() && this.getProvider() != null){
|
||||||
this.pushEnergy(EnumFacing.UP);
|
this.pushEnergy(EnumFacing.UP);
|
||||||
this.pushEnergy(EnumFacing.DOWN);
|
this.pushEnergy(EnumFacing.DOWN);
|
||||||
|
@ -98,11 +98,11 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBoundThingInRange(){
|
public boolean isBoundThingInRange(){
|
||||||
return super.isBoundThingInRange() && (worldObj.getTileEntity(boundPosition) instanceof IEnergyReceiver || worldObj.getTileEntity(boundPosition) instanceof IEnergyProvider);
|
return super.isBoundThingInRange() && (this.worldObj.getTileEntity(this.boundPosition) instanceof IEnergyReceiver || this.worldObj.getTileEntity(this.boundPosition) instanceof IEnergyProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pushEnergy(EnumFacing side){
|
private void pushEnergy(EnumFacing side){
|
||||||
TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, this.getPos());
|
TileEntity tile = WorldUtil.getTileEntityFromSide(side, this.worldObj, this.getPos());
|
||||||
if(tile != null && tile instanceof IEnergyReceiver && this.getProvider().getEnergyStored(side.getOpposite()) > 0){
|
if(tile != null && tile instanceof IEnergyReceiver && this.getProvider().getEnergyStored(side.getOpposite()) > 0){
|
||||||
if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite()) && this.canConnectEnergy(side)){
|
if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite()) && this.canConnectEnergy(side)){
|
||||||
int receive = this.extractEnergy(side, Math.min(((IEnergyReceiver)tile).getMaxEnergyStored(side.getOpposite())-((IEnergyReceiver)tile).getEnergyStored(side.getOpposite()), this.getEnergyStored(side)), true);
|
int receive = this.extractEnergy(side, Math.min(((IEnergyReceiver)tile).getMaxEnergyStored(side.getOpposite())-((IEnergyReceiver)tile).getEnergyStored(side.getOpposite()), this.getEnergyStored(side)), true);
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
|
||||||
|
|
||||||
public IInventory getInventory(){
|
public IInventory getInventory(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
TileEntity tile = worldObj.getTileEntity(boundPosition);
|
TileEntity tile = this.worldObj.getTileEntity(this.boundPosition);
|
||||||
if(tile instanceof IInventory){
|
if(tile instanceof IInventory){
|
||||||
return (IInventory)tile;
|
return (IInventory)tile;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBoundThingInRange(){
|
public boolean isBoundThingInRange(){
|
||||||
return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory;
|
return super.isBoundThingInRange() && this.worldObj.getTileEntity(this.boundPosition) instanceof IInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.isRedstonePowered && this.isBoundThingInRange() && this.getHandler() != null){
|
if(this.isRedstonePowered && this.isBoundThingInRange() && this.getHandler() != null){
|
||||||
this.pushFluid(EnumFacing.UP);
|
this.pushFluid(EnumFacing.UP);
|
||||||
this.pushFluid(EnumFacing.DOWN);
|
this.pushFluid(EnumFacing.DOWN);
|
||||||
|
@ -44,7 +44,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements
|
||||||
|
|
||||||
public IFluidHandler getHandler(){
|
public IFluidHandler getHandler(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
TileEntity tile = worldObj.getTileEntity(boundPosition);
|
TileEntity tile = this.worldObj.getTileEntity(this.boundPosition);
|
||||||
if(tile instanceof IFluidHandler){
|
if(tile instanceof IFluidHandler){
|
||||||
return (IFluidHandler)tile;
|
return (IFluidHandler)tile;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pushFluid(EnumFacing side){
|
private void pushFluid(EnumFacing side){
|
||||||
TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, this.pos);
|
TileEntity tile = WorldUtil.getTileEntityFromSide(side, this.worldObj, this.pos);
|
||||||
if(tile != null && tile instanceof IFluidHandler && this.getTankInfo(side) != null && this.getTankInfo(side).length > 0 && ((IFluidHandler)tile).getTankInfo(side.getOpposite()) != null && ((IFluidHandler)tile).getTankInfo(side.getOpposite()).length > 0){
|
if(tile != null && tile instanceof IFluidHandler && this.getTankInfo(side) != null && this.getTankInfo(side).length > 0 && ((IFluidHandler)tile).getTankInfo(side.getOpposite()) != null && ((IFluidHandler)tile).getTankInfo(side.getOpposite()).length > 0){
|
||||||
for(FluidTankInfo myInfo : this.getTankInfo(side)){
|
for(FluidTankInfo myInfo : this.getTankInfo(side)){
|
||||||
for(FluidTankInfo hisInfo : ((IFluidHandler)tile).getTankInfo(side.getOpposite())){
|
for(FluidTankInfo hisInfo : ((IFluidHandler)tile).getTankInfo(side.getOpposite())){
|
||||||
|
@ -73,7 +73,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBoundThingInRange(){
|
public boolean isBoundThingInRange(){
|
||||||
return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IFluidHandler;
|
return super.isBoundThingInRange() && this.worldObj.getTileEntity(this.boundPosition) instanceof IFluidHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -53,9 +53,9 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
super.writeSyncableNBT(compound, sync);
|
super.writeSyncableNBT(compound, sync);
|
||||||
compound.setInteger("Range", this.range);
|
compound.setInteger("Range", this.range);
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
compound.setInteger("XCoordOfTileStored", boundPosition.getX());
|
compound.setInteger("XCoordOfTileStored", this.boundPosition.getX());
|
||||||
compound.setInteger("YCoordOfTileStored", boundPosition.getY());
|
compound.setInteger("YCoordOfTileStored", this.boundPosition.getY());
|
||||||
compound.setInteger("ZCoordOfTileStored", boundPosition.getZ());
|
compound.setInteger("ZCoordOfTileStored", this.boundPosition.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
this.range = TileEntityPhantomface.upgradeRange(RANGE, worldObj, this.pos);
|
this.range = TileEntityPhantomface.upgradeRange(RANGE, this.worldObj, this.pos);
|
||||||
|
|
||||||
if(!this.hasBoundPosition()){
|
if(!this.hasBoundPosition()){
|
||||||
this.boundPosition = null;
|
this.boundPosition = null;
|
||||||
|
@ -112,7 +112,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
@Override
|
@Override
|
||||||
public boolean hasBoundPosition(){
|
public boolean hasBoundPosition(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
if(this.worldObj.getTileEntity(boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension())){
|
if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension())){
|
||||||
this.boundPosition = null;
|
this.boundPosition = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -123,16 +123,16 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
|
|
||||||
private void doWork(){
|
private void doWork(){
|
||||||
if(this.isBreaker){
|
if(this.isBreaker){
|
||||||
Block blockToBreak = PosUtil.getBlock(boundPosition, worldObj);
|
Block blockToBreak = PosUtil.getBlock(this.boundPosition, this.worldObj);
|
||||||
if(blockToBreak != null && blockToBreak.getBlockHardness(worldObj.getBlockState(boundPosition), worldObj, boundPosition) > -1.0F){
|
if(blockToBreak != null && blockToBreak.getBlockHardness(this.worldObj.getBlockState(this.boundPosition), this.worldObj, this.boundPosition) > -1.0F){
|
||||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||||
drops.addAll(blockToBreak.getDrops(worldObj, boundPosition, worldObj.getBlockState(boundPosition), 0));
|
drops.addAll(blockToBreak.getDrops(this.worldObj, this.boundPosition, this.worldObj.getBlockState(this.boundPosition), 0));
|
||||||
|
|
||||||
if(WorldUtil.addToInventory(this, drops, false, true)){
|
if(WorldUtil.addToInventory(this, drops, false, true)){
|
||||||
if(!ConfigValues.lessBlockBreakingEffects){
|
if(!ConfigValues.lessBlockBreakingEffects){
|
||||||
worldObj.playAuxSFX(2001, this.boundPosition, Block.getStateId(worldObj.getBlockState(this.boundPosition)));
|
this.worldObj.playAuxSFX(2001, this.boundPosition, Block.getStateId(this.worldObj.getBlockState(this.boundPosition)));
|
||||||
}
|
}
|
||||||
worldObj.setBlockToAir(this.boundPosition);
|
this.worldObj.setBlockToAir(this.boundPosition);
|
||||||
WorldUtil.addToInventory(this, drops, true, true);
|
WorldUtil.addToInventory(this, drops, true, true);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
|
int theSlot = WorldUtil.findFirstFilledSlot(this.slots);
|
||||||
this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(EnumFacing.UP, worldObj, boundPosition, this.slots[theSlot]));
|
this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(EnumFacing.UP, this.worldObj, this.boundPosition, this.slots[theSlot]));
|
||||||
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
|
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){
|
||||||
this.slots[theSlot] = null;
|
this.slots[theSlot] = null;
|
||||||
}
|
}
|
||||||
|
@ -158,11 +158,11 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
||||||
double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1);
|
double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1);
|
||||||
double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1;
|
double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1;
|
||||||
double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1);
|
double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1);
|
||||||
worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.ticksElapsed%80 == 0){
|
if(this.ticksElapsed%80 == 0){
|
||||||
PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), 2, 0.35F, TileEntityPhantomface.COLORS, 3);
|
PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), this.boundPosition.getX(), this.boundPosition.getY(), this.boundPosition.getZ(), 2, 0.35F, TileEntityPhantomface.COLORS, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,9 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
||||||
super.writeSyncableNBT(compound, sync);
|
super.writeSyncableNBT(compound, sync);
|
||||||
compound.setInteger("Range", this.range);
|
compound.setInteger("Range", this.range);
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
compound.setInteger("XCoordOfTileStored", boundPosition.getX());
|
compound.setInteger("XCoordOfTileStored", this.boundPosition.getX());
|
||||||
compound.setInteger("YCoordOfTileStored", boundPosition.getY());
|
compound.setInteger("YCoordOfTileStored", this.boundPosition.getY());
|
||||||
compound.setInteger("ZCoordOfTileStored", boundPosition.getZ());
|
compound.setInteger("ZCoordOfTileStored", this.boundPosition.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,14 +83,14 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
this.range = upgradeRange(RANGE, worldObj, this.getPos());
|
this.range = upgradeRange(RANGE, this.worldObj, this.getPos());
|
||||||
|
|
||||||
if(!this.hasBoundPosition()){
|
if(!this.hasBoundPosition()){
|
||||||
this.boundPosition = null;
|
this.boundPosition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.boundPosition != this.boundPosBefore || (this.boundPosition != null && PosUtil.getBlock(this.boundPosition, worldObj) != this.boundBlockBefore) || this.rangeBefore != this.range){
|
if(this.boundPosition != this.boundPosBefore || (this.boundPosition != null && PosUtil.getBlock(this.boundPosition, this.worldObj) != this.boundBlockBefore) || this.rangeBefore != this.range){
|
||||||
this.rangeBefore = this.range;
|
this.rangeBefore = this.range;
|
||||||
this.boundPosBefore = this.boundPosition;
|
this.boundPosBefore = this.boundPosition;
|
||||||
this.boundBlockBefore = this.boundPosition == null ? null : PosUtil.getBlock(this.boundPosition, this.worldObj);
|
this.boundBlockBefore = this.boundPosition == null ? null : PosUtil.getBlock(this.boundPosition, this.worldObj);
|
||||||
|
@ -117,7 +117,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
||||||
@Override
|
@Override
|
||||||
public boolean hasBoundPosition(){
|
public boolean hasBoundPosition(){
|
||||||
if(this.boundPosition != null){
|
if(this.boundPosition != null){
|
||||||
if(worldObj.getTileEntity(boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){
|
if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){
|
||||||
this.boundPosition = null;
|
this.boundPosition = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -137,11 +137,11 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
||||||
double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1);
|
double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1);
|
||||||
double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1;
|
double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1;
|
||||||
double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1);
|
double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1);
|
||||||
worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.ticksElapsed%80 == 0){
|
if(this.ticksElapsed%80 == 0){
|
||||||
PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), 2, 0.35F, COLORS, 3);
|
PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), this.boundPosition.getX(), this.boundPosition.getY(), this.boundPosition.getZ(), 2, 0.35F, COLORS, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!this.isRedstonePowered){
|
if(!this.isRedstonePowered){
|
||||||
ArrayList<EntityItem> items = (ArrayList<EntityItem>)this.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE));
|
ArrayList<EntityItem> items = (ArrayList<EntityItem>)this.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE));
|
||||||
if(!items.isEmpty()){
|
if(!items.isEmpty()){
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(!Objects.equals(this.name, this.nameBefore) && this.sendUpdateWithInterval()){
|
if(!Objects.equals(this.name, this.nameBefore) && this.sendUpdateWithInterval()){
|
||||||
this.nameBefore = this.name;
|
this.nameBefore = this.name;
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
if(this.amount > 0){
|
if(this.amount > 0){
|
||||||
if(this.slots[0] == null){
|
if(this.slots[0] == null){
|
||||||
int toSet = this.amount > 64 ? 64 : this.amount;
|
int toSet = this.amount > 64 ? 64 : this.amount;
|
||||||
|
@ -87,7 +87,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
||||||
int xp = this.buttonAmounts[buttonID] == -999 ? this.getPlayerXP(player)/ItemSolidifiedExperience.SOLID_XP_AMOUNT : this.buttonAmounts[buttonID];
|
int xp = this.buttonAmounts[buttonID] == -999 ? this.getPlayerXP(player)/ItemSolidifiedExperience.SOLID_XP_AMOUNT : this.buttonAmounts[buttonID];
|
||||||
if(this.amount < Short.MAX_VALUE-xp && this.getPlayerXP(player) >= ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp){
|
if(this.amount < Short.MAX_VALUE-xp && this.getPlayerXP(player) >= ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp){
|
||||||
this.addPlayerXP(player, -(ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp));
|
this.addPlayerXP(player, -(ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp));
|
||||||
if(!worldObj.isRemote){
|
if(!this.worldObj.isRemote){
|
||||||
this.amount += xp;
|
this.amount += xp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,11 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
||||||
* @param amount The Amount
|
* @param amount The Amount
|
||||||
*/
|
*/
|
||||||
private void addPlayerXP(EntityPlayer player, int amount){
|
private void addPlayerXP(EntityPlayer player, int amount){
|
||||||
int experience = getPlayerXP(player)+amount;
|
int experience = this.getPlayerXP(player)+amount;
|
||||||
player.experienceTotal = experience;
|
player.experienceTotal = experience;
|
||||||
|
|
||||||
int level = 0;
|
int level = 0;
|
||||||
while(getExperienceForLevel(level) <= experience){
|
while(this.getExperienceForLevel(level) <= experience){
|
||||||
level++;
|
level++;
|
||||||
}
|
}
|
||||||
player.experienceLevel = level-1;
|
player.experienceLevel = level-1;
|
||||||
|
|
|
@ -37,11 +37,11 @@ public class FluidStateMapper extends StateMapperBase implements ItemMeshDefinit
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state){
|
protected ModelResourceLocation getModelResourceLocation(IBlockState state){
|
||||||
return location;
|
return this.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack){
|
public ModelResourceLocation getModelLocation(ItemStack stack){
|
||||||
return location;
|
return this.location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue