Fixed some warnings

This commit is contained in:
drcrazy 2021-12-19 04:19:46 +03:00
parent a0d827fa3b
commit 774d42d944
6 changed files with 6 additions and 18 deletions

View file

@ -87,10 +87,7 @@ public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements
LightningEntity lightningBolt = EntityType.LIGHTNING_BOLT.create(world); LightningEntity lightningBolt = EntityType.LIGHTNING_BOLT.create(world);
lightningBolt.refreshPositionAfterTeleport(Vec3d.ofBottomCenter(world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, getPos()))); lightningBolt.refreshPositionAfterTeleport(Vec3d.ofBottomCenter(world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, getPos())));
if (!world.isClient) {
world.spawnEntity(lightningBolt); world.spawnEntity(lightningBolt);
}
addEnergy((long) (TechRebornConfig.lightningRodBaseEnergyStrike * (0.3F + weatherStrength))); addEnergy((long) (TechRebornConfig.lightningRodBaseEnergyStrike * (0.3F + weatherStrength)));
machineBaseBlock.setActive(true, world, pos); machineBaseBlock.setActive(true, world, pos);
onStatusHoldTicks = 400; onStatusHoldTicks = 400;

View file

@ -130,7 +130,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
// At this point, we know a light source is present and it's clear weather. We need to determine // At this point, we know a light source is present and it's clear weather. We need to determine
// the level of generation based on % of time through the day, with peak production at noon and // the level of generation based on % of time through the day, with peak production at noon and
// a smooth transition to night production as sun rises/sets // a smooth transition to night production as sun rises/sets
float multiplier = 0.0f; float multiplier;
if (skyAngle > 0.75) { if (skyAngle > 0.75) {
// Morning to noon // Morning to noon
multiplier = (0.25f - (1 - skyAngle)) / 0.25f; multiplier = (0.25f - (1 - skyAngle)) / 0.25f;

View file

@ -50,7 +50,6 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
public int totalCookingTime; public int totalCookingTime;
int fuelSlot; int fuelSlot;
Block toolDrop; Block toolDrop;
boolean active = false;
public AbstractIronMachineBlockEntity(BlockEntityType<?> blockEntityTypeIn, BlockPos pos, BlockState state, int fuelSlot, Block toolDrop) { public AbstractIronMachineBlockEntity(BlockEntityType<?> blockEntityTypeIn, BlockPos pos, BlockState state, int fuelSlot, Block toolDrop) {
super(blockEntityTypeIn, pos, state); super(blockEntityTypeIn, pos, state);
@ -63,7 +62,6 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
/** /**
* Checks that we have all inputs and can put output into slot * Checks that we have all inputs and can put output into slot
* *
* @return
*/ */
protected abstract boolean canSmelt(); protected abstract boolean canSmelt();

View file

@ -91,7 +91,7 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
private float getExperienceFor(ItemStack stack) { private float getExperienceFor() {
Optional<SmeltingRecipe> recipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, this, world); Optional<SmeltingRecipe> recipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, this, world);
return recipe.map(AbstractCookingRecipe::getExperience).orElse(0F); return recipe.map(AbstractCookingRecipe::getExperience).orElse(0F);
} }
@ -110,7 +110,7 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
} else if (inventory.getStack(outputSlot).isItemEqualIgnoreDamage(resultStack)) { } else if (inventory.getStack(outputSlot).isItemEqualIgnoreDamage(resultStack)) {
inventory.getStack(outputSlot).increment(resultStack.getCount()); inventory.getStack(outputSlot).increment(resultStack.getCount());
} }
experience += getExperienceFor(inputStack); experience += getExperienceFor();
if (inputStack.getCount() > 1) { if (inputStack.getCount() > 1) {
inventory.shrinkSlot(inputSlot, 1); inventory.shrinkSlot(inputSlot, 1);
} else { } else {

View file

@ -27,7 +27,6 @@ package techreborn.blockentity.machine.misc;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.FluidDrainable; import net.minecraft.block.FluidDrainable;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluid;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -52,10 +51,6 @@ public class DrainBlockEntity extends MachineBaseBlockEntity implements IToolDro
super(TRBlockEntities.DRAIN, pos, state); super(TRBlockEntities.DRAIN, pos, state);
} }
public DrainBlockEntity(BlockEntityType<?> blockEntityTypeIn, BlockPos pos, BlockState state) {
super(blockEntityTypeIn, pos, state);
}
@Override @Override
public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) { public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) {
super.tick(world, pos, state, blockEntity); super.tick(world, pos, state, blockEntity);

View file

@ -478,9 +478,7 @@ public class TRContent {
} }
private List<Block> allBlocks() { private List<Block> allBlocks() {
return Collections.unmodifiableList(Arrays.asList( return List.of(block, stairsBlock, slabBlock, wallBlock);
block, stairsBlock, slabBlock, wallBlock
));
} }
} }
@ -511,7 +509,7 @@ public class TRContent {
public static ItemConvertible[] getCasings() { public static ItemConvertible[] getCasings() {
return Arrays.stream(MachineBlocks.values()) return Arrays.stream(MachineBlocks.values())
.map((Function<MachineBlocks, ItemConvertible>) machineBlocks -> machineBlocks.casing::asItem) .map((Function<MachineBlocks, ItemConvertible>) machineBlocks -> machineBlocks.casing)
.toArray(ItemConvertible[]::new); .toArray(ItemConvertible[]::new);
} }
} }