More cleanup....

This commit is contained in:
Flanks255 2021-11-13 11:16:25 -06:00
parent 9b93760445
commit 7089cda9af
17 changed files with 42 additions and 51 deletions

View file

@ -16,7 +16,6 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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.World;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraft.block.AbstractBlock.Properties;
public class BlockFermentingBarrel extends BlockContainerBase {
@ -47,9 +43,11 @@ public class BlockFermentingBarrel extends BlockContainerBase {
if (!world.isClientSide) {
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel) world.getBlockEntity(pos);
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);
}
*/
}
return ActionResultType.PASS;
}

View file

@ -12,9 +12,6 @@ package de.ellpeck.actuallyadditions.mod.booklet.chapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
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 java.util.ArrayList;
@ -30,11 +27,13 @@ public class BookletChapterCrusher extends BookletChapter {
private static IBookletPage[] getPages(IBookletPage... pages) {
List<IBookletPage> allPages = new ArrayList<>();
allPages.addAll(Arrays.asList(pages));
/*
for (CrushingRecipe recipe : CrusherCrafting.MISC_RECIPES) {
allPages.add(new PageCrusherRecipe(allPages.size() + 1, recipe).setNoText());
}
*/
return allPages.toArray(new IBookletPage[allPages.size()]);
}
}

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraft.util.NonNullList;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -44,7 +45,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem {
}
@Override
public EnumRarity getRarity(ItemStack stack) {
public Rarity getRarity(ItemStack stack) {
return stack.getItemDamage() >= ALL_DUSTS.length
? EnumRarity.COMMON
: ALL_DUSTS[stack.getItemDamage()].rarity;

View file

@ -18,9 +18,8 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.entity.item.ItemEntity;
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.Rarity;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@ -99,9 +98,9 @@ public class ItemFoods extends ItemFoodBase {
}
@Override
public EnumRarity getRarity(ItemStack stack) {
public Rarity getRarity(ItemStack stack) {
return stack.getItemDamage() >= ALL_FOODS.length
? EnumRarity.COMMON
? Rarity.COMMON
: ALL_FOODS[stack.getItemDamage()].rarity;
}

View file

@ -187,7 +187,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput) {
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) {
return false;
}
@ -202,7 +202,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
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;
}
}
@ -217,7 +217,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
}
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) {
return;
}

View file

@ -10,6 +10,7 @@
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.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
@ -29,8 +30,6 @@ import net.minecraftforge.energy.IEnergyStorage;
import javax.annotation.Nullable;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityEnergizer extends TileEntityInventoryBase implements INamedContainerProvider {
public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 1000, 0);
@ -38,7 +37,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements INam
private int lastEnergy;
public TileEntityEnergizer() {
super(ActuallyTiles.ENERGIZER_TILE.get(), 2);
super(ActuallyBlocks.ENERGIZER.getTileEntityType(), 2);
}
@Override

View file

@ -10,6 +10,7 @@
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.util.ItemStackHandlerAA.IRemover;
import net.minecraft.entity.passive.AnimalEntity;
@ -32,8 +33,6 @@ import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityFeeder extends TileEntityInventoryBase implements INamedContainerProvider {
public static final int THRESHOLD = 30;
@ -44,7 +43,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements INamedC
private int lastTimer;
public TileEntityFeeder() {
super(ActuallyTiles.FEEDER_TILE.get(), 1);
super(ActuallyBlocks.FEEDER.getTileEntityType(), 1);
}
public int getCurrentTimerToScale(int i) {

View file

@ -10,6 +10,7 @@
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.network.gui.INumberReactor;
import net.minecraft.entity.player.PlayerEntity;
@ -36,8 +37,6 @@ import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisplay, INumberReactor, INamedContainerProvider {
public static final int USE_PER_SHOT = 500;
@ -59,7 +58,7 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp
private int oldEnergy;
public TileEntityFireworkBox() {
super(ActuallyTiles.FIREWORKBOX_TILE.get());
super(ActuallyBlocks.FIREWORK_BOX.getTileEntityType());
}
@Override

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@ -25,8 +26,6 @@ import net.minecraftforge.energy.IEnergyStorage;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityHeatCollector extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay {
public static final int ENERGY_PRODUCE = 40;
@ -37,7 +36,7 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE
private int disappearTime;
public TileEntityHeatCollector() {
super(ActuallyTiles.HEATCOLLECTOR_TILE.get());
super(ActuallyBlocks.HEAT_COLLECTOR.getTileEntityType());
}
@Override

View file

@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
import de.ellpeck.actuallyadditions.api.laser.LaserType;
import de.ellpeck.actuallyadditions.api.laser.Network;
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.util.StringUtil;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
@ -36,8 +37,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
public static final int CAP = 1000;
@ -85,7 +84,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
}
public TileEntityLaserRelayEnergy() {
this(ActuallyTiles.LASERRELAYENERGY_TILE.get());
this(ActuallyBlocks.LASER_RELAY.getTileEntityType());
}
private int transmitEnergy(Direction from, int maxTransmit, boolean simulate) {

View file

@ -10,12 +10,14 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
public class TileEntityLaserRelayEnergyAdvanced extends TileEntityLaserRelayEnergy {
public static final int CAP = 10000;
public TileEntityLaserRelayEnergyAdvanced() {
super(ActuallyTiles.LASERRELAYENERGYADVANCED_TILE.get());
super(ActuallyBlocks.LASER_RELAY_ADVANCED.getTileEntityType());
}
@Override

View file

@ -10,12 +10,14 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
public class TileEntityLaserRelayEnergyExtreme extends TileEntityLaserRelayEnergy {
public static final int CAP = 100000;
public TileEntityLaserRelayEnergyExtreme() {
super(ActuallyTiles.LASERRELAYENERGYEXTREME_TILE.get());
super(ActuallyBlocks.LASER_RELAY_EXTREME.getTileEntityType());
}
@Override

View file

@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
import de.ellpeck.actuallyadditions.api.laser.LaserType;
import de.ellpeck.actuallyadditions.api.laser.Network;
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.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -37,9 +38,6 @@ import java.util.Map;
import java.util.Set;
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 final ConcurrentHashMap<Direction, TileEntity> handlersAround = new ConcurrentHashMap<>();
@ -47,7 +45,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay {
private Mode mode = Mode.BOTH;
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++) {
Direction facing = Direction.values()[i];

View file

@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
import de.ellpeck.actuallyadditions.api.laser.LaserType;
import de.ellpeck.actuallyadditions.api.laser.Network;
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.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -35,8 +36,6 @@ import net.minecraftforge.items.IItemHandler;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
public final Map<BlockPos, SlotlessableItemHandlerWrapper> handlersAround = new ConcurrentHashMap<>();
@ -47,7 +46,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
}
public TileEntityLaserRelayItem() {
this(ActuallyTiles.LASERRELAYITEM_TILE.get());
this(ActuallyBlocks.LASER_RELAY_ITEM.getTileEntityType());
}
public int getPriority() {
@ -74,7 +73,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay {
BlockPos pos = this.getBlockPos().relative(side);
if (this.level.hasChunkAt(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());
Object slotlessHandler = null;

View file

@ -10,6 +10,7 @@
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.ContainerLaserRelayItemWhitelist;
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 TileEntityLaserRelayItemAdvanced() {
super(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get());
super(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getTileEntityType());
}
@Override
@ -131,7 +132,7 @@ public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem i
public void updateEntity() {
super.updateEntity();
if (!this.world.isRemote) {
if (!this.level.isClientSide) {
if ((this.leftFilter.needsUpdateSend() || this.rightFilter.needsUpdateSend()) && this.sendUpdateWithInterval()) {
this.leftFilter.updateLasts();
this.rightFilter.updateLasts();

View file

@ -21,8 +21,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.IEnergyStorage;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyDisplay {
public static final int NOT_MULTI = 0;
@ -36,7 +34,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
private int oldEnergy;
public TileEntityLavaFactoryController() {
super(ActuallyTiles.LAVAFACTORYCONTROLLER_TILE.get());
super(ActuallyBlocks.LAVA_FACTORY_CONTROLLER.getTileEntityType());
}
@Override
@ -82,7 +80,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
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)};
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();
BlockState state = this.level.getBlockState(pos);
Block block = state.getBlock();

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
import net.minecraftforge.common.util.LazyOptional;
@ -18,8 +19,6 @@ import net.minecraftforge.energy.IEnergyStorage;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
public class TileEntityShockSuppressor extends TileEntityBase implements IEnergyDisplay {
public static final List<TileEntityShockSuppressor> SUPPRESSORS = new ArrayList<>();
@ -32,7 +31,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy
private int oldEnergy;
public TileEntityShockSuppressor() {
super(ActuallyTiles.SHOCKSUPPRESSOR_TILE.get());
super(ActuallyBlocks.SHOCK_SUPPRESSOR.getTileEntityType());
}
@Override