Refactor and import cleanup (Excluding network PR changed files)
This commit is contained in:
parent
a36a0e6f4a
commit
c4ef977f16
165 changed files with 1572 additions and 1625 deletions
|
@ -36,7 +36,7 @@ public enum EFluidGenerator {
|
|||
@Nonnull
|
||||
private final String recipeID;
|
||||
|
||||
private EFluidGenerator(@Nonnull String recipeID) {
|
||||
EFluidGenerator(@Nonnull String recipeID) {
|
||||
this.recipeID = recipeID;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,8 +83,6 @@ public class FluidGeneratorRecipe {
|
|||
return false;
|
||||
} else if (!FluidUtils.fluidEquals(other.fluid, fluid))
|
||||
return false;
|
||||
if (generatorType != other.generatorType)
|
||||
return false;
|
||||
return true;
|
||||
return generatorType == other.generatorType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,10 +83,7 @@ public class FluidGeneratorRecipeList {
|
|||
return false;
|
||||
FluidGeneratorRecipeList other = (FluidGeneratorRecipeList) obj;
|
||||
if (recipes == null) {
|
||||
if (other.recipes != null)
|
||||
return false;
|
||||
} else if (!recipes.equals(other.recipes))
|
||||
return false;
|
||||
return true;
|
||||
return other.recipes == null;
|
||||
} else return recipes.equals(other.recipes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.api.generator;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.fluid.Fluid;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
|
|
@ -34,7 +34,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntit
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FusionReactorRecipe extends RebornRecipe {
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public enum SlotType {
|
|||
.orElse(null);
|
||||
}
|
||||
|
||||
private BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> slotBiConsumer;
|
||||
private final BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> slotBiConsumer;
|
||||
|
||||
SlotType(BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> slotBiConsumer) {
|
||||
this.slotBiConsumer = slotBiConsumer;
|
||||
|
|
|
@ -89,8 +89,7 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn
|
|||
if (!inputStack.isEmpty()) {
|
||||
if (FluidUtils.isContainerEmpty(inputStack) && !tank.getFluidAmount().isEmpty()) {
|
||||
FluidUtils.fillContainers(tank, inventory, 0, 1, tank.getFluid());
|
||||
}
|
||||
else if (inputStack.getItem() instanceof ItemFluidInfo && getRecipes().getRecipeForFluid(((ItemFluidInfo) inputStack.getItem()).getFluid(inputStack)).isPresent()) {
|
||||
} else if (inputStack.getItem() instanceof ItemFluidInfo && getRecipes().getRecipeForFluid(((ItemFluidInfo) inputStack.getItem()).getFluid(inputStack)).isPresent()) {
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
}
|
||||
}
|
||||
|
@ -118,8 +117,7 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn
|
|||
|
||||
if (world.getTime() - lastOutput < 30 && !isActive()) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
|
||||
}
|
||||
else if (world.getTime() - lastOutput > 30 && isActive()) {
|
||||
} else if (world.getTime() - lastOutput > 30 && isActive()) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,9 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
if (onStatusHoldTicks > 0) { --onStatusHoldTicks; }
|
||||
if (onStatusHoldTicks > 0) {
|
||||
--onStatusHoldTicks;
|
||||
}
|
||||
|
||||
Block BEBlock = getCachedState().getBlock();
|
||||
if (!(BEBlock instanceof BlockMachineBase)) {
|
||||
|
@ -83,7 +85,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
lightningBolt.method_29495(Vec3d.ofBottomCenter(world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, getPos())));
|
||||
|
||||
if (!world.isClient) {
|
||||
((ServerWorld) world).spawnEntity(lightningBolt);
|
||||
world.spawnEntity(lightningBolt);
|
||||
}
|
||||
addEnergy(TechRebornConfig.lightningRodBaseEnergyStrike * (0.3F + weatherStrength));
|
||||
machineBaseBlock.setActive(true, world, pos);
|
||||
|
@ -110,10 +112,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
|
||||
public boolean isValidIronFence(int y) {
|
||||
Block block = this.world.getBlockState(new BlockPos(pos.getX(), y, pos.getZ())).getBlock();
|
||||
if(block == TRContent.REFINED_IRON_FENCE){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return block == TRContent.REFINED_IRON_FENCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.blockentity.generator;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
|
|
@ -55,8 +55,7 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT
|
|||
if (waterblocks > 0) {
|
||||
addEnergy(waterblocks * TechRebornConfig.waterMillEnergyMultiplier);
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import techreborn.init.TRBlockEntities;
|
|||
public class LampBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop {
|
||||
|
||||
private static int capacity = 33;
|
||||
private static final int capacity = 33;
|
||||
|
||||
public LampBlockEntity() {
|
||||
super(TRBlockEntities.LAMP);
|
||||
|
|
|
@ -38,7 +38,6 @@ import reborncore.common.util.RebornInventory;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IRecipeCrafterProvider {
|
||||
|
|
|
@ -60,6 +60,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
|
||||
/**
|
||||
* Checks that we have all inputs and can put output into slot
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract boolean canSmelt();
|
||||
|
@ -73,6 +74,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
/**
|
||||
* Returns the number of ticks that the supplied fuel item will keep the
|
||||
* furnace burning, or 0 if the item isn't fuel
|
||||
*
|
||||
* @param stack Itemstack of fuel
|
||||
* @return Integer Number of ticks
|
||||
*/
|
||||
|
@ -85,6 +87,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
|
||||
/**
|
||||
* Returns remaining fraction of fuel burn time
|
||||
*
|
||||
* @param scale Scale to use for burn time
|
||||
* @return int scaled remaining fuel burn time
|
||||
*/
|
||||
|
@ -98,6 +101,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
|
||||
/**
|
||||
* Returns crafting progress
|
||||
*
|
||||
* @param scale Scale to use for crafting progress
|
||||
* @return int Scaled crafting progress
|
||||
*/
|
||||
|
@ -110,6 +114,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
|
||||
/**
|
||||
* Returns true if Iron Machine is burning fuel thus can do work
|
||||
*
|
||||
* @return Boolean True if machine is burning
|
||||
*/
|
||||
public boolean isBurning() {
|
||||
|
|
|
@ -87,7 +87,7 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
|
|||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return (RecipeCrafter) crafter;
|
||||
return crafter;
|
||||
}
|
||||
|
||||
// TilePowerAcceptor
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
|
|
|
@ -150,9 +150,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
}
|
||||
}
|
||||
if (!missingOutput) {
|
||||
if (hasOutputSpace(recipe.getOutput(), 9)) {
|
||||
return true;
|
||||
}
|
||||
return hasOutputSpace(recipe.getOutput(), 9);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -173,9 +171,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
return true;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(stack, output, true, true)) {
|
||||
if (stack.getMaxCount() > stack.getCount() + output.getCount()) {
|
||||
return true;
|
||||
}
|
||||
return stack.getMaxCount() > stack.getCount() + output.getCount();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -156,8 +156,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
|||
ItemStack outputStack = inventory.getStack(outputSlot);
|
||||
if (outputStack.isEmpty()) {
|
||||
inventory.setStack(outputSlot, recipe.getOutput().copy());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Just increment. We already checked stack match and stack size
|
||||
outputStack.increment(1);
|
||||
}
|
||||
|
@ -187,6 +186,7 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
|||
public void setCookTimeTotal(int cookTimeTotal) {
|
||||
this.cookTimeTotal = cookTimeTotal;
|
||||
}
|
||||
|
||||
// TilePowerAcceptor
|
||||
@Override
|
||||
public void tick() {
|
||||
|
|
|
@ -77,8 +77,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
|
|||
if (randomchance == 1) {
|
||||
if (inventory.getStack(1).isEmpty()) {
|
||||
inventory.setStack(1, itemstack.copy());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
inventory.getStack(1).increment(itemstack.getCount());
|
||||
}
|
||||
}
|
||||
|
@ -92,10 +91,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
|
|||
public boolean hasSlotGotSpace(int slot) {
|
||||
if (inventory.getStack(slot).isEmpty()) {
|
||||
return true;
|
||||
} else if (inventory.getStack(slot).getCount() < inventory.getStack(slot).getMaxCount()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else return inventory.getStack(slot).getCount() < inventory.getStack(slot).getMaxCount();
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
|
@ -129,8 +125,7 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
|
|||
boolean updateInventory = false;
|
||||
if (canRecycle() && !isBurning() && getEnergy() != 0) {
|
||||
setBurning(true);
|
||||
}
|
||||
else if (isBurning()) {
|
||||
} else if (isBurning()) {
|
||||
if (useEnergy(getEuPerTick(cost)) != getEuPerTick(cost)) {
|
||||
this.setBurning(false);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
@Nonnull
|
||||
public ItemStack currentRecipeOutput;
|
||||
public RollingMachineRecipe currentRecipe;
|
||||
private int outputSlot;
|
||||
private final int outputSlot;
|
||||
public boolean locked = false;
|
||||
public int balanceSlot = 0;
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
List<Integer> possibleSlots = new ArrayList<>();
|
||||
for (int s = 0; s < currentRecipe.getPreviewInputs().size(); s++) {
|
||||
ItemStack stackInSlot = inventory.getStack(s);
|
||||
Ingredient ingredient = (Ingredient) currentRecipe.getPreviewInputs().get(s);
|
||||
Ingredient ingredient = currentRecipe.getPreviewInputs().get(s);
|
||||
if (ingredient != Ingredient.EMPTY && ingredient.test(sourceStack)) {
|
||||
if (stackInSlot.isEmpty()) {
|
||||
possibleSlots.add(s);
|
||||
|
|
|
@ -76,8 +76,7 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
|
|||
private void addOutputProducts(int slot) {
|
||||
if (inventory.getStack(slot).isEmpty()) {
|
||||
inventory.setStack(slot, TRContent.Parts.UU_MATTER.getStack());
|
||||
}
|
||||
else if (ItemUtils.isItemEqual(this.inventory.getStack(slot), TRContent.Parts.UU_MATTER.getStack(), true, true)) {
|
||||
} else if (ItemUtils.isItemEqual(this.inventory.getStack(slot), TRContent.Parts.UU_MATTER.getStack(), true, true)) {
|
||||
inventory.getStack(slot).setCount((Math.min(64, 1 + inventory.getStack(slot).getCount())));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,9 @@ public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity
|
|||
// MachineBaseBlockEntity
|
||||
@Override
|
||||
public void setFacing(Direction enumFacing) {
|
||||
if (world == null) { return; }
|
||||
if (world == null) {
|
||||
return;
|
||||
}
|
||||
world.setBlockState(pos, world.getBlockState(pos).with(EnergyStorageBlock.FACING, enumFacing));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ import techreborn.init.TRContent;
|
|||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*
|
||||
*/
|
||||
public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ import techreborn.init.TRContent;
|
|||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*
|
||||
*/
|
||||
public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.util.ArrayList;
|
|||
public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
|
||||
|
||||
private int connectedBlocks = 0;
|
||||
private ArrayList<LesuNetwork> countedNetworks = new ArrayList<>();
|
||||
private final ArrayList<LesuNetwork> countedNetworks = new ArrayList<>();
|
||||
|
||||
public LapotronicSUBlockEntity() {
|
||||
super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnergyTier.LOW, TechRebornConfig.lesuStoragePerBlock);
|
||||
|
@ -62,11 +62,9 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
|
|||
maxOutput = TechRebornConfig.lesuBaseOutput + (connectedBlocks * TechRebornConfig.lesuExtraIOPerBlock);
|
||||
if (connectedBlocks < 32) {
|
||||
return;
|
||||
}
|
||||
else if (connectedBlocks < 128) {
|
||||
} else if (connectedBlocks < 128) {
|
||||
maxInput = EnergyTier.MEDIUM.getMaxInput();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
maxInput = EnergyTier.HIGH.getMaxInput();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.blockentity.storage.fluid;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
|
|
@ -32,10 +32,8 @@ import net.minecraft.text.LiteralText;
|
|||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.IToolDrop;
|
||||
|
|
|
@ -30,7 +30,6 @@ import techreborn.client.GuiType;
|
|||
|
||||
/**
|
||||
* @author modmuss50
|
||||
*
|
||||
*/
|
||||
public class DataDrivenMachineBlock extends GenericMachineBlock {
|
||||
|
||||
|
|
|
@ -34,11 +34,10 @@ import java.util.function.Supplier;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class GenericMachineBlock extends BlockMachineBase {
|
||||
|
||||
private IMachineGuiHandler gui;
|
||||
private final IMachineGuiHandler gui;
|
||||
Supplier<BlockEntity> blockEntityClass;
|
||||
|
||||
public GenericMachineBlock(IMachineGuiHandler gui, Supplier<BlockEntity> blockEntityClass) {
|
||||
|
@ -62,7 +61,6 @@ public class GenericMachineBlock extends BlockMachineBase {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IMachineGuiHandler getGui() {
|
||||
return gui;
|
||||
|
|
|
@ -56,8 +56,8 @@ public class BlockLamp extends BaseBlockEntityProvider {
|
|||
public static BooleanProperty ACTIVE;
|
||||
protected final VoxelShape[] shape;
|
||||
|
||||
private int cost;
|
||||
private static int brightness = 15;
|
||||
private final int cost;
|
||||
private static final int brightness = 15;
|
||||
|
||||
public BlockLamp(int cost, double depth, double width) {
|
||||
super(FabricBlockSettings.of(Material.REDSTONE_LAMP).strength(2f, 2f).lightLevel(brightness));
|
||||
|
@ -97,7 +97,7 @@ public class BlockLamp extends BaseBlockEntityProvider {
|
|||
}
|
||||
|
||||
public static void setActive(Boolean active, World world, BlockPos pos) {
|
||||
Direction facing = (Direction)world.getBlockState(pos).get(FACING);
|
||||
Direction facing = world.getBlockState(pos).get(FACING);
|
||||
BlockState state = world.getBlockState(pos).with(ACTIVE, active).with(FACING, facing);
|
||||
world.setBlockState(pos, state, 3);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class IronAlloyFurnaceBlock extends GenericMachineBlock {
|
|||
worldIn.playSound(x, y, z, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
|
||||
}
|
||||
|
||||
Direction facing = (Direction) stateIn.get(FACING);
|
||||
Direction facing = stateIn.get(FACING);
|
||||
Direction.Axis facing$Axis = facing.getAxis();
|
||||
double double_5 = rand.nextDouble() * 0.6D - 0.3D;
|
||||
double deltaX = facing$Axis == Direction.Axis.X ? (double) facing.getOffsetX() * 0.52D : double_5;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class IronFurnaceBlock extends GenericMachineBlock {
|
|||
worldIn.playSound(x, y, z, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
|
||||
}
|
||||
|
||||
Direction facing = (Direction) stateIn.get(FACING);
|
||||
Direction facing = stateIn.get(FACING);
|
||||
Direction.Axis facing$Axis = facing.getAxis();
|
||||
double double_5 = rand.nextDouble() * 0.6D - 0.3D;
|
||||
double deltaX = facing$Axis == Direction.Axis.X ? (double) facing.getOffsetX() * 0.52D : double_5;
|
||||
|
|
|
@ -177,7 +177,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
|
||||
private final String name;
|
||||
|
||||
private PlayerDetectorType(String name) {
|
||||
PlayerDetectorType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class BlockAlarm extends BaseBlockEntityProvider {
|
|||
}
|
||||
|
||||
public static Direction getFacing(BlockState state) {
|
||||
return (Direction) state.get(FACING);
|
||||
return state.get(FACING);
|
||||
}
|
||||
|
||||
public static void setFacing(Direction facing, World world, BlockPos pos) {
|
||||
|
|
|
@ -63,8 +63,7 @@ public class BlockComputerCube extends BlockMachineBase {
|
|||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
rotate(worldIn.getBlockState(pos), BlockRotation.CLOCKWISE_90);
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,10 @@ public class BlockNuke extends BaseBlock {
|
|||
|
||||
public void ignite(World worldIn, BlockPos pos, BlockState state, LivingEntity igniter) {
|
||||
if (!worldIn.isClient) {
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (float) pos.getX() + 0.5F,
|
||||
pos.getY(), (float) pos.getZ() + 0.5F, igniter);
|
||||
worldIn.spawnEntity(entitynukeprimed);
|
||||
worldIn.playSound((PlayerEntity) null, entitynukeprimed.getX(), entitynukeprimed.getY(), entitynukeprimed.getZ(),
|
||||
worldIn.playSound(null, entitynukeprimed.getX(), entitynukeprimed.getY(), entitynukeprimed.getZ(),
|
||||
SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ public class BlockNuke extends BaseBlock {
|
|||
@Override
|
||||
public void onDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
||||
if (!worldIn.isClient) {
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getCausingEntity());
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (float) pos.getX() + 0.5F,
|
||||
pos.getY(), (float) pos.getZ() + 0.5F, explosionIn.getCausingEntity());
|
||||
entitynukeprimed.setFuse(worldIn.random.nextInt(TechRebornConfig.nukeFuseTime / 4) + TechRebornConfig.nukeFuseTime / 8);
|
||||
worldIn.spawnEntity(entitynukeprimed);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,9 @@ public class BlockRubberLog extends PillarBlock {
|
|||
if (Energy.valid(stack)) {
|
||||
Energy.of(stack).use(20);
|
||||
} else {
|
||||
stack.damage(1, playerIn, player -> { player.sendToolBreakStatus(hand); });
|
||||
stack.damage(1, playerIn, player -> {
|
||||
player.sendToolBreakStatus(hand);
|
||||
});
|
||||
}
|
||||
if (!playerIn.inventory.insertStack(TRContent.Parts.SAP.getStack())) {
|
||||
WorldUtils.dropItem(TRContent.Parts.SAP.getStack(), worldIn, pos.offset(hitResult.getSide()));
|
||||
|
|
|
@ -29,7 +29,6 @@ import techreborn.utils.InitUtils;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberButtonBlock extends WoodButtonBlock {
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import techreborn.utils.InitUtils;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberDoorBlock extends DoorBlock {
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import techreborn.utils.InitUtils;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberPressurePlateBlock extends PressurePlateBlock {
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import techreborn.utils.InitUtils;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberTrapdoorBlock extends TrapdoorBlock {
|
||||
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.BucketItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ToolItem;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
|
@ -41,12 +39,10 @@ import net.minecraft.world.World;
|
|||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import reborncore.common.fluid.RebornBucketItem;
|
||||
import reborncore.common.fluid.container.FluidInstance;
|
||||
import reborncore.common.fluid.container.ItemFluidInfo;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
import techreborn.client.GuiType;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.api.items.InventoryBase;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
|
@ -114,7 +113,6 @@ public class StorageUnitBlock extends BlockMachineBase {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IMachineGuiHandler getGui() {
|
||||
return GuiType.STORAGE_UNIT;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
package techreborn.client;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
|
|
|
@ -87,7 +87,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
furnaceExp -= PlayerUtils.getLevelExperience(player.experienceLevel);
|
||||
++levels;
|
||||
}
|
||||
message = message + "+" + String.valueOf(levels) + "L";
|
||||
message = message + "+" + levels + "L";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
|
||||
|
|
|
@ -58,7 +58,9 @@ import java.util.function.Supplier;
|
|||
public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBakedModel {
|
||||
|
||||
public abstract ModelIdentifier getBaseModel();
|
||||
|
||||
public abstract ModelIdentifier getBackgroundModel();
|
||||
|
||||
public abstract ModelIdentifier getFluidModel();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,34 +24,20 @@
|
|||
|
||||
package techreborn.client.render.entitys;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SignBlock;
|
||||
import net.minecraft.block.WallSignBlock;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.render.OverlayTexture;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
import net.minecraft.client.util.SpriteIdentifier;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.StringRenderable;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static net.minecraft.client.render.block.entity.SignBlockEntityRenderer.getModelTexture;
|
||||
|
||||
/**
|
||||
* Created by drcrazy on 07-Jan-20 for TechReborn-1.15.
|
||||
*/
|
||||
|
|
|
@ -34,8 +34,8 @@ import techreborn.init.TRContent;
|
|||
|
||||
public class DestructoPackScreenHandler extends ScreenHandler {
|
||||
|
||||
private PlayerEntity player;
|
||||
private RebornInventory<?> inv;
|
||||
private final PlayerEntity player;
|
||||
private final RebornInventory<?> inv;
|
||||
|
||||
public DestructoPackScreenHandler(int syncID, PlayerEntity player) {
|
||||
super(null, syncID);
|
||||
|
|
|
@ -37,19 +37,16 @@ public class FurnaceFuelSlot extends BaseSlot {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsert(ItemStack stack)
|
||||
{
|
||||
public boolean canInsert(ItemStack stack) {
|
||||
return AbstractFurnaceBlockEntity.canUseAsFuel(stack) || isBucket(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxStackAmount(ItemStack stack)
|
||||
{
|
||||
public int getMaxStackAmount(ItemStack stack) {
|
||||
return isBucket(stack) ? 1 : super.getMaxStackAmount(stack);
|
||||
}
|
||||
|
||||
public static boolean isBucket(ItemStack stack)
|
||||
{
|
||||
public static boolean isBucket(ItemStack stack) {
|
||||
return stack.getItem() == Items.BUCKET;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,8 +109,8 @@ public class TRRecipeParser {
|
|||
}
|
||||
return new StackIngredient(Collections.singletonList(stack), amount, tag, requireEmpty);
|
||||
}
|
||||
}
|
||||
else throw new CDSyntaxError("Illegal object passed to TechReborn ingredient parser of type " + input.getClass().getName());
|
||||
} else
|
||||
throw new CDSyntaxError("Illegal object passed to TechReborn ingredient parser of type " + input.getClass().getName());
|
||||
}
|
||||
|
||||
public static FluidInstance parseFluid(String fluid) {
|
||||
|
|
|
@ -62,7 +62,7 @@ import java.util.concurrent.Executor;
|
|||
|
||||
public class TRTweaker implements Tweaker {
|
||||
public static final TRTweaker INSTANCE = new TRTweaker();
|
||||
private RecipeTweaker tweaker = RecipeTweaker.INSTANCE;
|
||||
private final RecipeTweaker tweaker = RecipeTweaker.INSTANCE;
|
||||
private JsonObject debug;
|
||||
|
||||
List<FluidGeneratorRecipe> added = new ArrayList<>();
|
||||
|
@ -112,6 +112,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Create a fluid ingredient
|
||||
*
|
||||
* @param fluid The fluid required.
|
||||
* @param holders The fluid-holding items the fluid can be in, or [] for any.
|
||||
* @param amount The amount of fluid needed, or -1 for any.
|
||||
|
@ -136,6 +137,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a generic TechReborn recipe.
|
||||
*
|
||||
* @param type The type of RebornRecipe to add.
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
|
@ -169,6 +171,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to smelt in an alloy smelter.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -180,6 +183,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to assemble in an assembling machine.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -191,6 +195,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to smelt in a TechReborn blast furnace.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -216,6 +221,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a centrifuge.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -227,6 +233,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a chemical reactor.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -238,6 +245,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to compress in a compressor.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -249,6 +257,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to distil in a distillation tower.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -260,6 +269,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to extract in an extractor.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -271,6 +281,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a grinder.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -282,6 +293,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an implosion compressor.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -293,6 +305,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an industrial electrolyzer.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -304,6 +317,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an industrial grinder.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -328,6 +342,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an industrial grinder.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -354,6 +369,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an industria sawmilll.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -378,6 +394,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in an industrial sawmill.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -404,6 +421,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a recycler.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -415,6 +433,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to get from a scrapbox. Input is always a scrap box.
|
||||
*
|
||||
* @param output The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
* @param time How many ticks (1/20 of a second) to process for.
|
||||
|
@ -425,6 +444,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a vacuum freezer.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -436,6 +456,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a fluid replicator.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
* @param time How many ticks (1/20 of a second) to process for.
|
||||
|
@ -457,6 +478,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a fusion reactor.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -483,6 +505,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a rolling machine recipe from a 2D array of inputs, like a standard CraftTweaker recipe.
|
||||
*
|
||||
* @param inputs the 2D array (array of arrays) of inputs to use.
|
||||
* @param output The output of the recipe.
|
||||
*/
|
||||
|
@ -499,6 +522,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a rolling machine recipe from a 1D array of inputs.
|
||||
*
|
||||
* @param inputs The input item or tag ids required in order: left to right, top to bottom.
|
||||
* @param output The output of the recipe.
|
||||
* @param width How many rows the recipe needs.
|
||||
|
@ -522,6 +546,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a rolling machine recipe from a pattern and dictionary.
|
||||
*
|
||||
* @param pattern A crafting pattern like one you'd find in a vanilla recipe JSON.
|
||||
* @param dictionary A map of single characters to item or tag ids.
|
||||
* @param output The output of the recipe.
|
||||
|
@ -543,6 +568,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a solid canning machine.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -554,6 +580,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a recipe to process in a wire mill.
|
||||
*
|
||||
* @param inputs The input ingredients for the recipe.
|
||||
* @param outputs The outputs of the recipe.
|
||||
* @param power How much power the recipe consumes per tick.
|
||||
|
@ -565,6 +592,7 @@ public class TRTweaker implements Tweaker {
|
|||
|
||||
/**
|
||||
* Register a fluid to process in a fluid generator.
|
||||
*
|
||||
* @param generator The type of generator: thermal, gas, diesel, semifluid, or plasma.
|
||||
* @param fluid The fluid to add a recipe for.
|
||||
* @param euPerMB How much EU should be generated per millibucket of fluid.
|
||||
|
|
|
@ -49,7 +49,7 @@ import java.util.List;
|
|||
public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCategory<MachineRecipeDisplay<R>> {
|
||||
|
||||
private final RebornRecipeType<R> rebornRecipeType;
|
||||
private int recipeLines;
|
||||
private final int recipeLines;
|
||||
|
||||
MachineRecipeCategory(RebornRecipeType<R> rebornRecipeType) {
|
||||
this(rebornRecipeType, 2);
|
||||
|
|
|
@ -40,8 +40,8 @@ import java.util.Optional;
|
|||
public class MachineRecipeDisplay<R extends RebornRecipe> implements RecipeDisplay {
|
||||
|
||||
private final R recipe;
|
||||
private List<List<EntryStack>> inputs;
|
||||
private List<EntryStack> outputs;
|
||||
private final List<List<EntryStack>> inputs;
|
||||
private final List<EntryStack> outputs;
|
||||
private int energy = 0;
|
||||
private int heat = 0;
|
||||
private int time = 0;
|
||||
|
|
|
@ -43,8 +43,8 @@ import java.util.List;
|
|||
|
||||
public class FluidGeneratorRecipeCategory implements RecipeCategory<FluidGeneratorRecipeDisplay> {
|
||||
|
||||
private TRContent.Machine generator;
|
||||
private Identifier identifier;
|
||||
private final TRContent.Machine generator;
|
||||
private final Identifier identifier;
|
||||
|
||||
public FluidGeneratorRecipeCategory(TRContent.Machine generator) {
|
||||
this.generator = generator;
|
||||
|
|
|
@ -36,9 +36,9 @@ import java.util.List;
|
|||
|
||||
public class FluidGeneratorRecipeDisplay implements RecipeDisplay {
|
||||
|
||||
private List<List<EntryStack>> inputs;
|
||||
private Identifier category;
|
||||
private int totalEnergy;
|
||||
private final List<List<EntryStack>> inputs;
|
||||
private final Identifier category;
|
||||
private final int totalEnergy;
|
||||
|
||||
public FluidGeneratorRecipeDisplay(FluidGeneratorRecipe recipe, Identifier category) {
|
||||
this.category = category;
|
||||
|
|
|
@ -41,9 +41,9 @@ import java.util.List;
|
|||
public class FluidReplicatorRecipeDisplay implements RecipeDisplay {
|
||||
|
||||
private final FluidReplicatorRecipe recipe;
|
||||
private List<List<EntryStack>> inputs;
|
||||
private List<EntryStack> output;
|
||||
private FluidInstance fluidInstance;
|
||||
private final List<List<EntryStack>> inputs;
|
||||
private final List<EntryStack> output;
|
||||
private final FluidInstance fluidInstance;
|
||||
private int energy = 0;
|
||||
private int time = 0;
|
||||
|
||||
|
|
|
@ -28,16 +28,10 @@ import net.minecraft.entity.EntityType;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.MovementType;
|
||||
import net.minecraft.entity.TntEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.explosion.RebornExplosion;
|
||||
import team.reborn.energy.EnergyTier;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
/**
|
||||
* Created by Mark on 13/03/2016.
|
||||
|
|
|
@ -59,7 +59,7 @@ import java.util.Map;
|
|||
|
||||
public class StackToolTipHandler implements ItemTooltipCallback {
|
||||
|
||||
private static ArrayList<Block> wipBlocks = new ArrayList<>();
|
||||
private static final ArrayList<Block> wipBlocks = new ArrayList<>();
|
||||
public static final Map<Item, Boolean> ITEM_ID = Maps.newHashMap();
|
||||
|
||||
public static void setup() {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class TRRecipeHandler {
|
|||
if (!recipe.getId().getNamespace().equals(TechReborn.MOD_ID)) {
|
||||
return false;
|
||||
}
|
||||
return !recipe.getPreviewInputs().stream().anyMatch((Predicate<Ingredient>) ingredient -> ingredient.test(TRContent.Parts.UU_MATTER.getStack()));
|
||||
return !recipe.getPreviewInputs().stream().anyMatch(ingredient -> ingredient.test(TRContent.Parts.UU_MATTER.getStack()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ public class ModLoot {
|
|||
LootPoolEntry energyFlowChip = makeEntry(Parts.ENERGY_FLOW_CHIP);
|
||||
|
||||
|
||||
|
||||
LootPool poolBasic = FabricLootPoolBuilder.builder().withEntry(copperIngot).withEntry(tinIngot)
|
||||
.withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedronIngot).withEntry(advancedalloyIngot)
|
||||
.withEntry(basicFrame).withEntry(basicCircuit).withEntry(rubberSapling).rolls(UniformLootTableRange.between(1.0f, 2.0f))
|
||||
|
|
|
@ -73,7 +73,7 @@ import java.util.function.Supplier;
|
|||
|
||||
public class TRBlockEntities {
|
||||
|
||||
private static List<BlockEntityType<?>> TYPES = new ArrayList<>();
|
||||
private static final List<BlockEntityType<?>> TYPES = new ArrayList<>();
|
||||
|
||||
|
||||
public static final BlockEntityType<StorageUnitBaseBlockEntity> STORAGE_UNIT = register(StorageUnitBaseBlockEntity::new, "storage_unit", TRContent.StorageUnit.values());
|
||||
|
|
|
@ -25,12 +25,7 @@
|
|||
package techreborn.init;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.OreBlock;
|
||||
import net.minecraft.block.SlabBlock;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
import net.minecraft.block.WallBlock;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
|
@ -67,11 +62,7 @@ import techreborn.blocks.machine.tier0.IronAlloyFurnaceBlock;
|
|||
import techreborn.blocks.machine.tier0.IronFurnaceBlock;
|
||||
import techreborn.blocks.machine.tier1.BlockPlayerDetector;
|
||||
import techreborn.blocks.machine.tier1.ResinBasinBlock;
|
||||
import techreborn.blocks.misc.BlockAlarm;
|
||||
import techreborn.blocks.misc.BlockMachineCasing;
|
||||
import techreborn.blocks.misc.BlockMachineFrame;
|
||||
import techreborn.blocks.misc.BlockStorage;
|
||||
import techreborn.blocks.misc.TechRebornStairsBlock;
|
||||
import techreborn.blocks.misc.*;
|
||||
import techreborn.blocks.storage.energy.*;
|
||||
import techreborn.blocks.storage.fluid.TankUnitBlock;
|
||||
import techreborn.blocks.storage.item.StorageUnitBlock;
|
||||
|
@ -88,11 +79,7 @@ import techreborn.items.armor.QuantumSuitItem;
|
|||
import techreborn.utils.InitUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
|
|
@ -96,8 +96,7 @@ public class TRDispenserBehavior {
|
|||
} else {
|
||||
return super.dispenseSilently(pointer, stack);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// drain cell
|
||||
if (cell.placeFluid(null, pointer.getWorld(), blockPos, null, stack)) {
|
||||
ItemStack emptyCell = cell.getEmpty();
|
||||
|
|
|
@ -57,9 +57,13 @@ public enum TRToolTier implements ToolMaterial {
|
|||
* against.
|
||||
*/
|
||||
private final float efficiency;
|
||||
/** Damage versus entities. */
|
||||
/**
|
||||
* Damage versus entities.
|
||||
*/
|
||||
private final float attackDamage;
|
||||
/** Defines the natural enchantability factor of the material. */
|
||||
/**
|
||||
* Defines the natural enchantability factor of the material.
|
||||
*/
|
||||
private final int enchantability;
|
||||
private final Lazy<Ingredient> repairMaterial;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
|||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
package techreborn.init.template;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
|
|
|
@ -102,7 +102,9 @@ public class NanosaberItem extends SwordItem implements EnergyHolder, ItemDurabi
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnchantable(ItemStack stack) { return true; }
|
||||
public boolean isEnchantable(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
|
|
|
@ -147,8 +147,6 @@ public class FluidUtils {
|
|||
if (!(inputStack.getItem() instanceof ItemFluidInfo))
|
||||
return false;
|
||||
ItemFluidInfo itemFluidInfo = (ItemFluidInfo) inputStack.getItem();
|
||||
if (itemFluidInfo.getFluid(inputStack) != Fluids.EMPTY)
|
||||
return false;
|
||||
return true;
|
||||
return itemFluidInfo.getFluid(inputStack) == Fluids.EMPTY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.utils;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class PlayerUtils {
|
||||
|
||||
|
|
|
@ -41,9 +41,7 @@ public class RecipeUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Used to get the matching output of a recipe type that only has 1 input
|
||||
*
|
||||
*/
|
||||
public static <T extends Recipe<?>> ItemStack getMatchingRecipes(World world, RecipeType<T> type, ItemStack input) {
|
||||
return getRecipes(world, type).stream()
|
||||
|
|
|
@ -85,7 +85,7 @@ public class ToolTipAssistUtils {
|
|||
if (I18n.hasTranslation(key)) {
|
||||
if (!hidden || Screen.hasShiftDown()) {
|
||||
String info = I18n.translate(key);
|
||||
String infoLines[] = info.split("\\r?\\n");
|
||||
String[] infoLines = info.split("\\r?\\n");
|
||||
|
||||
for (String infoLine : infoLines) {
|
||||
list.add(new LiteralText(infoColour + infoLine));
|
||||
|
|
|
@ -71,6 +71,7 @@ public class ToolsUtil {
|
|||
|
||||
/**
|
||||
* Fills in set of BlockPos which should be broken by AOE mining
|
||||
*
|
||||
* @param worldIn World reference
|
||||
* @param pos BlockPos Position of originally broken block
|
||||
* @param entityLiving LivingEntity Player who broke block
|
||||
|
|
|
@ -40,7 +40,6 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class RubberTreeFeature extends TreeFeature {
|
||||
|
||||
|
@ -82,5 +81,4 @@ public class RubberTreeFeature extends TreeFeature {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class WorldGenerator {
|
||||
|
||||
|
@ -64,7 +63,7 @@ public class WorldGenerator {
|
|||
|
||||
public static TreeFeatureConfig RUBBER_TREE_CONFIG;
|
||||
|
||||
private static List<Biome> checkedBiomes = new ArrayList<>();
|
||||
private static final List<Biome> checkedBiomes = new ArrayList<>();
|
||||
|
||||
public static void initBiomeFeatures() {
|
||||
setupTrees();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue