mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
More cleanup....
This commit is contained in:
parent
9b93760445
commit
7089cda9af
17 changed files with 42 additions and 51 deletions
|
@ -16,7 +16,6 @@ import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.SoundType;
|
import net.minecraft.block.SoundType;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ActionResultType;
|
import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
|
@ -27,9 +26,6 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
||||||
import net.minecraft.world.IBlockReader;
|
import net.minecraft.world.IBlockReader;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ToolType;
|
import net.minecraftforge.common.ToolType;
|
||||||
import net.minecraftforge.fml.network.NetworkHooks;
|
|
||||||
|
|
||||||
import net.minecraft.block.AbstractBlock.Properties;
|
|
||||||
|
|
||||||
public class BlockFermentingBarrel extends BlockContainerBase {
|
public class BlockFermentingBarrel extends BlockContainerBase {
|
||||||
|
|
||||||
|
@ -47,9 +43,11 @@ public class BlockFermentingBarrel extends BlockContainerBase {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel) world.getBlockEntity(pos);
|
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel) world.getBlockEntity(pos);
|
||||||
if (press != null) {
|
if (press != null) {
|
||||||
if (!this.tryUseItemOnTank(player, hand, press.canolaTank) && !this.tryUseItemOnTank(player, hand, press.oilTank)) {
|
/* if (!this.tryUseItemOnTank(player, hand, press.tanks.canolaTank) && !this.tryUseItemOnTank(player, hand, press.tanks.oilTank)) {
|
||||||
NetworkHooks.openGui((ServerPlayerEntity) player, press, pos);
|
NetworkHooks.openGui((ServerPlayerEntity) player, press, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return ActionResultType.PASS;
|
return ActionResultType.PASS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,6 @@ package de.ellpeck.actuallyadditions.mod.booklet.chapter;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrusherRecipe;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -30,11 +27,13 @@ public class BookletChapterCrusher extends BookletChapter {
|
||||||
private static IBookletPage[] getPages(IBookletPage... pages) {
|
private static IBookletPage[] getPages(IBookletPage... pages) {
|
||||||
List<IBookletPage> allPages = new ArrayList<>();
|
List<IBookletPage> allPages = new ArrayList<>();
|
||||||
allPages.addAll(Arrays.asList(pages));
|
allPages.addAll(Arrays.asList(pages));
|
||||||
|
/*
|
||||||
for (CrushingRecipe recipe : CrusherCrafting.MISC_RECIPES) {
|
for (CrushingRecipe recipe : CrusherCrafting.MISC_RECIPES) {
|
||||||
allPages.add(new PageCrusherRecipe(allPages.size() + 1, recipe).setNoText());
|
allPages.add(new PageCrusherRecipe(allPages.size() + 1, recipe).setNoText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
return allPages.toArray(new IBookletPage[allPages.size()]);
|
return allPages.toArray(new IBookletPage[allPages.size()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.renderer.color.IItemColor;
|
import net.minecraft.client.renderer.color.IItemColor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Rarity;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -44,7 +45,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack) {
|
public Rarity getRarity(ItemStack stack) {
|
||||||
return stack.getItemDamage() >= ALL_DUSTS.length
|
return stack.getItemDamage() >= ALL_DUSTS.length
|
||||||
? EnumRarity.COMMON
|
? EnumRarity.COMMON
|
||||||
: ALL_DUSTS[stack.getItemDamage()].rarity;
|
: ALL_DUSTS[stack.getItemDamage()].rarity;
|
||||||
|
|
|
@ -18,9 +18,8 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Rarity;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
@ -99,9 +98,9 @@ public class ItemFoods extends ItemFoodBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack) {
|
public Rarity getRarity(ItemStack stack) {
|
||||||
return stack.getItemDamage() >= ALL_FOODS.length
|
return stack.getItemDamage() >= ALL_FOODS.length
|
||||||
? EnumRarity.COMMON
|
? Rarity.COMMON
|
||||||
: ALL_FOODS[stack.getItemDamage()].rarity;
|
: ALL_FOODS[stack.getItemDamage()].rarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
|
||||||
|
|
||||||
public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput) {
|
public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput) {
|
||||||
if (StackUtil.isValid(this.inv.getStackInSlot(theInput))) {
|
if (StackUtil.isValid(this.inv.getStackInSlot(theInput))) {
|
||||||
CrushingRecipe recipe = CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput));
|
CrushingRecipe recipe = null;//CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput)); //TODO
|
||||||
if (recipe == null) {
|
if (recipe == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
|
||||||
outputTwo.setDamage(0);
|
outputTwo.setDamage(0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).sameItem(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).isItemEqual(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
|
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).sameItem(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).sameItem(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput) {
|
public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput) {
|
||||||
CrushingRecipe recipe = CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput));
|
CrushingRecipe recipe = null; //CrusherRecipeRegistry.getRecipeFromInput(this.inv.getStackInSlot(theInput));//TODO
|
||||||
if (recipe == null) {
|
if (recipe == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
|
@ -29,8 +30,6 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityEnergizer extends TileEntityInventoryBase implements INamedContainerProvider {
|
public class TileEntityEnergizer extends TileEntityInventoryBase implements INamedContainerProvider {
|
||||||
|
|
||||||
public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 1000, 0);
|
public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 1000, 0);
|
||||||
|
@ -38,7 +37,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements INam
|
||||||
private int lastEnergy;
|
private int lastEnergy;
|
||||||
|
|
||||||
public TileEntityEnergizer() {
|
public TileEntityEnergizer() {
|
||||||
super(ActuallyTiles.ENERGIZER_TILE.get(), 2);
|
super(ActuallyBlocks.ENERGIZER.getTileEntityType(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||||
import net.minecraft.entity.passive.AnimalEntity;
|
import net.minecraft.entity.passive.AnimalEntity;
|
||||||
|
@ -32,8 +33,6 @@ import javax.annotation.Nullable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityFeeder extends TileEntityInventoryBase implements INamedContainerProvider {
|
public class TileEntityFeeder extends TileEntityInventoryBase implements INamedContainerProvider {
|
||||||
|
|
||||||
public static final int THRESHOLD = 30;
|
public static final int THRESHOLD = 30;
|
||||||
|
@ -44,7 +43,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements INamedC
|
||||||
private int lastTimer;
|
private int lastTimer;
|
||||||
|
|
||||||
public TileEntityFeeder() {
|
public TileEntityFeeder() {
|
||||||
super(ActuallyTiles.FEEDER_TILE.get(), 1);
|
super(ActuallyBlocks.FEEDER.getTileEntityType(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentTimerToScale(int i) {
|
public int getCurrentTimerToScale(int i) {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFireworkBox;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFireworkBox;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor;
|
import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -36,8 +37,6 @@ import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisplay, INumberReactor, INamedContainerProvider {
|
public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisplay, INumberReactor, INamedContainerProvider {
|
||||||
|
|
||||||
public static final int USE_PER_SHOT = 500;
|
public static final int USE_PER_SHOT = 500;
|
||||||
|
@ -59,7 +58,7 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp
|
||||||
private int oldEnergy;
|
private int oldEnergy;
|
||||||
|
|
||||||
public TileEntityFireworkBox() {
|
public TileEntityFireworkBox() {
|
||||||
super(ActuallyTiles.FIREWORKBOX_TILE.get());
|
super(ActuallyBlocks.FIREWORK_BOX.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -25,8 +26,6 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityHeatCollector extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay {
|
public class TileEntityHeatCollector extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay {
|
||||||
|
|
||||||
public static final int ENERGY_PRODUCE = 40;
|
public static final int ENERGY_PRODUCE = 40;
|
||||||
|
@ -37,7 +36,7 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE
|
||||||
private int disappearTime;
|
private int disappearTime;
|
||||||
|
|
||||||
public TileEntityHeatCollector() {
|
public TileEntityHeatCollector() {
|
||||||
super(ActuallyTiles.HEATCOLLECTOR_TILE.get());
|
super(ActuallyBlocks.HEAT_COLLECTOR.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.Network;
|
import de.ellpeck.actuallyadditions.api.laser.Network;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
||||||
|
@ -36,8 +37,6 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
|
public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
|
||||||
|
|
||||||
public static final int CAP = 1000;
|
public static final int CAP = 1000;
|
||||||
|
@ -85,7 +84,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityLaserRelayEnergy() {
|
public TileEntityLaserRelayEnergy() {
|
||||||
this(ActuallyTiles.LASERRELAYENERGY_TILE.get());
|
this(ActuallyBlocks.LASER_RELAY.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
private int transmitEnergy(Direction from, int maxTransmit, boolean simulate) {
|
private int transmitEnergy(Direction from, int maxTransmit, boolean simulate) {
|
||||||
|
|
|
@ -10,12 +10,14 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
|
|
||||||
public class TileEntityLaserRelayEnergyAdvanced extends TileEntityLaserRelayEnergy {
|
public class TileEntityLaserRelayEnergyAdvanced extends TileEntityLaserRelayEnergy {
|
||||||
|
|
||||||
public static final int CAP = 10000;
|
public static final int CAP = 10000;
|
||||||
|
|
||||||
public TileEntityLaserRelayEnergyAdvanced() {
|
public TileEntityLaserRelayEnergyAdvanced() {
|
||||||
super(ActuallyTiles.LASERRELAYENERGYADVANCED_TILE.get());
|
super(ActuallyBlocks.LASER_RELAY_ADVANCED.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,12 +10,14 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
|
|
||||||
public class TileEntityLaserRelayEnergyExtreme extends TileEntityLaserRelayEnergy {
|
public class TileEntityLaserRelayEnergyExtreme extends TileEntityLaserRelayEnergy {
|
||||||
|
|
||||||
public static final int CAP = 100000;
|
public static final int CAP = 100000;
|
||||||
|
|
||||||
public TileEntityLaserRelayEnergyExtreme() {
|
public TileEntityLaserRelayEnergyExtreme() {
|
||||||
super(ActuallyTiles.LASERRELAYENERGYEXTREME_TILE.get());
|
super(ActuallyBlocks.LASER_RELAY_EXTREME.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.Network;
|
import de.ellpeck.actuallyadditions.api.laser.Network;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy.Mode;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy.Mode;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
|
@ -37,9 +38,6 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
|
||||||
|
|
||||||
public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
|
public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
|
||||||
|
|
||||||
public final ConcurrentHashMap<Direction, TileEntity> handlersAround = new ConcurrentHashMap<>();
|
public final ConcurrentHashMap<Direction, TileEntity> handlersAround = new ConcurrentHashMap<>();
|
||||||
|
@ -47,7 +45,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
|
||||||
private Mode mode = Mode.BOTH;
|
private Mode mode = Mode.BOTH;
|
||||||
|
|
||||||
public TileEntityLaserRelayFluids() {
|
public TileEntityLaserRelayFluids() {
|
||||||
super(ActuallyTiles.LASERRELAYFLUIDS_TILE.get(), LaserType.FLUID);
|
super(ActuallyBlocks.LASER_RELAY_FLUIDS.getTileEntityType(), LaserType.FLUID);
|
||||||
|
|
||||||
for (int i = 0; i < this.fluidHandlers.length; i++) {
|
for (int i = 0; i < this.fluidHandlers.length; i++) {
|
||||||
Direction facing = Direction.values()[i];
|
Direction facing = Direction.values()[i];
|
||||||
|
|
|
@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
||||||
import de.ellpeck.actuallyadditions.api.laser.Network;
|
import de.ellpeck.actuallyadditions.api.laser.Network;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface.GenericItemHandlerInfo;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface.GenericItemHandlerInfo;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||||
|
@ -35,8 +36,6 @@ import net.minecraftforge.items.IItemHandler;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
|
public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
|
||||||
|
|
||||||
public final Map<BlockPos, SlotlessableItemHandlerWrapper> handlersAround = new ConcurrentHashMap<>();
|
public final Map<BlockPos, SlotlessableItemHandlerWrapper> handlersAround = new ConcurrentHashMap<>();
|
||||||
|
@ -47,7 +46,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityLaserRelayItem() {
|
public TileEntityLaserRelayItem() {
|
||||||
this(ActuallyTiles.LASERRELAYITEM_TILE.get());
|
this(ActuallyBlocks.LASER_RELAY_ITEM.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPriority() {
|
public int getPriority() {
|
||||||
|
@ -74,7 +73,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
|
||||||
BlockPos pos = this.getBlockPos().relative(side);
|
BlockPos pos = this.getBlockPos().relative(side);
|
||||||
if (this.level.hasChunkAt(pos)) {
|
if (this.level.hasChunkAt(pos)) {
|
||||||
TileEntity tile = this.level.getBlockEntity(pos);
|
TileEntity tile = this.level.getBlockEntity(pos);
|
||||||
if (tile != null && !(tile instanceof TileEntityItemViewer) && !(tile instanceof TileEntityLaserRelay)) {
|
if (tile != null && !(tile instanceof TileEntityItemInterface) && !(tile instanceof TileEntityLaserRelay)) {
|
||||||
LazyOptional<IItemHandler> itemHandler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite());
|
LazyOptional<IItemHandler> itemHandler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite());
|
||||||
|
|
||||||
Object slotlessHandler = null;
|
Object slotlessHandler = null;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
|
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
|
||||||
|
@ -35,7 +36,7 @@ public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem i
|
||||||
public FilterSettings rightFilter = new FilterSettings(12, true, true, false, false, 0, -2000);
|
public FilterSettings rightFilter = new FilterSettings(12, true, true, false, false, 0, -2000);
|
||||||
|
|
||||||
public TileEntityLaserRelayItemAdvanced() {
|
public TileEntityLaserRelayItemAdvanced() {
|
||||||
super(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get());
|
super(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,7 +132,7 @@ public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem i
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
|
||||||
if (!this.world.isRemote) {
|
if (!this.level.isClientSide) {
|
||||||
if ((this.leftFilter.needsUpdateSend() || this.rightFilter.needsUpdateSend()) && this.sendUpdateWithInterval()) {
|
if ((this.leftFilter.needsUpdateSend() || this.rightFilter.needsUpdateSend()) && this.sendUpdateWithInterval()) {
|
||||||
this.leftFilter.updateLasts();
|
this.leftFilter.updateLasts();
|
||||||
this.rightFilter.updateLasts();
|
this.rightFilter.updateLasts();
|
||||||
|
|
|
@ -21,8 +21,6 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
import net.minecraftforge.energy.IEnergyStorage;
|
import net.minecraftforge.energy.IEnergyStorage;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyDisplay {
|
public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyDisplay {
|
||||||
|
|
||||||
public static final int NOT_MULTI = 0;
|
public static final int NOT_MULTI = 0;
|
||||||
|
@ -36,7 +34,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
||||||
private int oldEnergy;
|
private int oldEnergy;
|
||||||
|
|
||||||
public TileEntityLavaFactoryController() {
|
public TileEntityLavaFactoryController() {
|
||||||
super(ActuallyTiles.LAVAFACTORYCONTROLLER_TILE.get());
|
super(ActuallyBlocks.LAVA_FACTORY_CONTROLLER.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,7 +80,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
||||||
BlockPos thisPos = this.worldPosition;
|
BlockPos thisPos = this.worldPosition;
|
||||||
BlockPos[] positions = new BlockPos[]{thisPos.offset(1, 1, 0), thisPos.offset(-1, 1, 0), thisPos.offset(0, 1, 1), thisPos.offset(0, 1, -1)};
|
BlockPos[] positions = new BlockPos[]{thisPos.offset(1, 1, 0), thisPos.offset(-1, 1, 0), thisPos.offset(0, 1, 1), thisPos.offset(0, 1, -1)};
|
||||||
|
|
||||||
if (this.level != null && WorldUtil.hasBlocksInPlacesGiven(positions, ActuallyBlocks.LAVA_CASING.get(), this.level)) {
|
if (this.level != null && WorldUtil.hasBlocksInPlacesGiven(positions, ActuallyBlocks.LAVA_FACTORY_CASING.get(), this.level)) {
|
||||||
BlockPos pos = thisPos.above();
|
BlockPos pos = thisPos.above();
|
||||||
BlockState state = this.level.getBlockState(pos);
|
BlockState state = this.level.getBlockState(pos);
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
|
@ -18,8 +19,6 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
|
||||||
|
|
||||||
public class TileEntityShockSuppressor extends TileEntityBase implements IEnergyDisplay {
|
public class TileEntityShockSuppressor extends TileEntityBase implements IEnergyDisplay {
|
||||||
|
|
||||||
public static final List<TileEntityShockSuppressor> SUPPRESSORS = new ArrayList<>();
|
public static final List<TileEntityShockSuppressor> SUPPRESSORS = new ArrayList<>();
|
||||||
|
@ -32,7 +31,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy
|
||||||
private int oldEnergy;
|
private int oldEnergy;
|
||||||
|
|
||||||
public TileEntityShockSuppressor() {
|
public TileEntityShockSuppressor() {
|
||||||
super(ActuallyTiles.SHOCKSUPPRESSOR_TILE.get());
|
super(ActuallyBlocks.SHOCK_SUPPRESSOR.getTileEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue