Migrate mappings, 1888 errors to go
This commit is contained in:
parent
b0c7a733c7
commit
9520a3e607
83 changed files with 407 additions and 408 deletions
|
@ -97,8 +97,8 @@ public class RollingMachineRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DefaultedList<Ingredient> getPreviewInputs() {
|
||||
return shapedRecipe.getPreviewInputs();
|
||||
public DefaultedList<Ingredient> getIngredients() {
|
||||
return shapedRecipe.getIngredients();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtHelper;
|
||||
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
|
||||
import net.minecraft.text.LiteralText;
|
||||
|
@ -122,20 +122,20 @@ public class CableBlockEntity extends BlockEntity
|
|||
|
||||
// BlockEntity
|
||||
@Override
|
||||
public CompoundTag toInitialChunkDataTag() {
|
||||
return toTag(new CompoundTag());
|
||||
public NbtCompound toInitialChunkDataNbt() {
|
||||
return writeNbt(new NbtCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntityUpdateS2CPacket toUpdatePacket() {
|
||||
CompoundTag nbtTag = new CompoundTag();
|
||||
toTag(nbtTag);
|
||||
NbtCompound nbtTag = new NbtCompound();
|
||||
writeNbt(nbtTag);
|
||||
return new BlockEntityUpdateS2CPacket(getPos(), 1, nbtTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag compound) {
|
||||
super.fromTag(blockState, compound);
|
||||
public void readNbt(BlockState blockState, NbtCompound compound) {
|
||||
super.readNbt(blockState, compound);
|
||||
if (compound.contains("energy")) {
|
||||
energy = compound.getDouble("energy");
|
||||
}
|
||||
|
@ -147,8 +147,8 @@ public class CableBlockEntity extends BlockEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag compound) {
|
||||
super.toTag(compound);
|
||||
public NbtCompound writeNbt(NbtCompound compound) {
|
||||
super.writeNbt(compound);
|
||||
compound.putDouble("energy", energy);
|
||||
if (cover != null) {
|
||||
compound.put("cover", NbtHelper.fromBlockState(cover));
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.generator;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.api.IToolDrop;
|
||||
|
@ -167,14 +167,14 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
tank.read(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tank.write(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
@ -264,13 +264,13 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tag) {
|
||||
public void readNbt(BlockState blockState, NbtCompound tag) {
|
||||
if (world == null) {
|
||||
// We are in BlockEntity.create method during chunk load.
|
||||
this.checkOverfill = false;
|
||||
}
|
||||
updatePanel();
|
||||
super.fromTag(blockState, tag);
|
||||
super.readNbt(blockState, tag);
|
||||
}
|
||||
|
||||
// MachineBaseBlockEntity
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
|
|||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
|
@ -132,16 +132,16 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
|
|||
|
||||
// MachineBaseBlockEntity
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag compoundTag) {
|
||||
super.fromTag(blockState, compoundTag);
|
||||
public void readNbt(BlockState blockState, NbtCompound compoundTag) {
|
||||
super.readNbt(blockState, compoundTag);
|
||||
burnTime = compoundTag.getInt("BurnTime");
|
||||
totalBurnTime = compoundTag.getInt("TotalBurnTime");
|
||||
progress = compoundTag.getInt("Progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag compoundTag) {
|
||||
super.toTag(compoundTag);
|
||||
public NbtCompound writeNbt(NbtCompound compoundTag) {
|
||||
super.writeNbt(compoundTag);
|
||||
compoundTag.putInt("BurnTime", burnTime);
|
||||
compoundTag.putInt("TotalBurnTime", totalBurnTime);
|
||||
compoundTag.putInt("Progress", progress);
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.ExperienceOrbEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.recipe.AbstractCookingRecipe;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
|
@ -143,14 +143,14 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag compoundTag) {
|
||||
super.fromTag(blockState, compoundTag);
|
||||
public void readNbt(BlockState blockState, NbtCompound compoundTag) {
|
||||
super.readNbt(blockState, compoundTag);
|
||||
experience = compoundTag.getFloat("Experience");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag compoundTag) {
|
||||
super.toTag(compoundTag);
|
||||
public NbtCompound writeNbt(NbtCompound compoundTag) {
|
||||
super.writeNbt(compoundTag);
|
||||
compoundTag.putFloat("Experience", experience);
|
||||
return compoundTag;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
@ -66,20 +66,20 @@ public class AlarmBlockEntity extends BlockEntity
|
|||
|
||||
// BlockEntity
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag compound) {
|
||||
public NbtCompound writeNbt(NbtCompound compound) {
|
||||
if (compound == null) {
|
||||
compound = new CompoundTag();
|
||||
compound = new NbtCompound();
|
||||
}
|
||||
compound.putInt("selectedSound", this.selectedSound);
|
||||
return super.toTag(compound);
|
||||
return super.writeNbt(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag compound) {
|
||||
public void readNbt(BlockState blockState, NbtCompound compound) {
|
||||
if (compound != null && compound.contains("selectedSound")) {
|
||||
selectedSound = compound.getInt("selectedSound");
|
||||
}
|
||||
super.fromTag(blockState, compound);
|
||||
super.readNbt(blockState, compound);
|
||||
}
|
||||
|
||||
// Tickable
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.machine.multiblock;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BuiltScreenHandler;
|
||||
|
@ -99,14 +99,14 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
|
|||
|
||||
// TilePowerAcceptor
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
tank.read(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tank.write(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.machine.multiblock;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -352,8 +352,8 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
this.craftingTickTime = tagCompound.getInt("craftingTickTime");
|
||||
this.neededPower = tagCompound.getInt("neededPower");
|
||||
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
|
||||
|
@ -368,8 +368,8 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tagCompound.putInt("craftingTickTime", this.craftingTickTime);
|
||||
tagCompound.putInt("neededPower", this.neededPower);
|
||||
tagCompound.putBoolean("hasStartedCrafting", this.hasStartedCrafting);
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BuiltScreenHandler;
|
||||
|
@ -93,14 +93,14 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
tank.read(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tank.write(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BuiltScreenHandler;
|
||||
|
@ -95,14 +95,14 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
|
|||
|
||||
// TilePowerAcceptor
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
tank.read(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tank.write(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.recipe.CraftingRecipe;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
|
@ -162,7 +162,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
|
||||
if (!hasOutputSpace(recipe.getOutput(), OUTPUT_SLOT)) return false;
|
||||
|
||||
DefaultedList<ItemStack> remainingStacks = recipe.getRemainingStacks(crafting);
|
||||
DefaultedList<ItemStack> remainingStacks = recipe.getRemainder(crafting);
|
||||
for (ItemStack stack : remainingStacks){
|
||||
if (!stack.isEmpty() && !hasRoomForExtraItem(stack)) return false;
|
||||
}
|
||||
|
@ -193,8 +193,8 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
if (recipe == null || !canMake(recipe)) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < recipe.getPreviewInputs().size(); i++) {
|
||||
DefaultedList<Ingredient> ingredients = recipe.getPreviewInputs();
|
||||
for (int i = 0; i < recipe.getIngredients().size(); i++) {
|
||||
DefaultedList<Ingredient> ingredients = recipe.getIngredients();
|
||||
Ingredient ingredient = ingredients.get(i);
|
||||
// Looks for the best slot to take it from
|
||||
ItemStack bestSlot = inventory.getStack(i);
|
||||
|
@ -267,13 +267,13 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
return Optional.empty();
|
||||
}
|
||||
List<Integer> possibleSlots = new ArrayList<>();
|
||||
for (int s = 0; s < currentRecipe.getPreviewInputs().size(); s++) {
|
||||
for (int s = 0; s < currentRecipe.getIngredients().size(); s++) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (possibleSlots.contains(i)) {
|
||||
continue;
|
||||
}
|
||||
ItemStack stackInSlot = inventory.getStack(i);
|
||||
Ingredient ingredient = currentRecipe.getPreviewInputs().get(s);
|
||||
Ingredient ingredient = currentRecipe.getIngredients().get(s);
|
||||
if (ingredient != Ingredient.EMPTY && ingredient.test(sourceStack)) {
|
||||
if (stackInSlot.getItem() == sourceStack.getItem()) {
|
||||
possibleSlots.add(i);
|
||||
|
@ -405,17 +405,17 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tag) {
|
||||
public NbtCompound writeNbt(NbtCompound tag) {
|
||||
tag.putBoolean("locked", locked);
|
||||
return super.toTag(tag);
|
||||
return super.writeNbt(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tag) {
|
||||
public void readNbt(BlockState blockState, NbtCompound tag) {
|
||||
if (tag.contains("locked")) {
|
||||
locked = tag.getBoolean("locked");
|
||||
}
|
||||
super.fromTag(blockState, tag);
|
||||
super.readNbt(blockState, tag);
|
||||
}
|
||||
|
||||
// MachineBaseBlockEntity
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.machine.tier1;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
|
@ -117,14 +117,14 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tag) {
|
||||
super.fromTag(blockState, tag);
|
||||
public void readNbt(BlockState blockState, NbtCompound tag) {
|
||||
super.readNbt(blockState, tag);
|
||||
owenerUdid = tag.getString("ownerID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tag) {
|
||||
super.toTag(tag);
|
||||
public NbtCompound writeNbt(NbtCompound tag) {
|
||||
super.writeNbt(tag);
|
||||
tag.putString("ownerID", owenerUdid);
|
||||
return tag;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.block.entity.HopperBlockEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -141,15 +141,15 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
|
||||
this.isFull = blockState.get(ResinBasinBlock.FULL);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -206,9 +206,9 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
return Optional.empty();
|
||||
}
|
||||
List<Integer> possibleSlots = new ArrayList<>();
|
||||
for (int s = 0; s < currentRecipe.getPreviewInputs().size(); s++) {
|
||||
for (int s = 0; s < currentRecipe.getIngredients().size(); s++) {
|
||||
ItemStack stackInSlot = inventory.getStack(s);
|
||||
Ingredient ingredient = currentRecipe.getPreviewInputs().get(s);
|
||||
Ingredient ingredient = currentRecipe.getIngredients().get(s);
|
||||
if (ingredient != Ingredient.EMPTY && ingredient.test(sourceStack)) {
|
||||
if (stackInSlot.isEmpty()) {
|
||||
possibleSlots.add(s);
|
||||
|
@ -343,16 +343,16 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
this.isRunning = tagCompound.getBoolean("isRunning");
|
||||
this.tickTime = tagCompound.getInt("tickTime");
|
||||
this.locked = tagCompound.getBoolean("locked");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tagCompound.putBoolean("isRunning", this.isRunning);
|
||||
tagCompound.putInt("tickTime", this.tickTime);
|
||||
tagCompound.putBoolean("locked", locked);
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
|
@ -124,8 +124,8 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tagCompound.putInt("radius", radius);
|
||||
if (ownerUdid != null && !ownerUdid.isEmpty()){
|
||||
tagCompound.putString("ownerUdid", ownerUdid);
|
||||
|
@ -135,8 +135,8 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
|
||||
super.fromTag(blockState, nbttagcompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound nbttagcompound) {
|
||||
super.readNbt(blockState, nbttagcompound);
|
||||
this.radius = nbttagcompound.getInt("radius");
|
||||
this.ownerUdid = nbttagcompound.getString("ownerUdid");
|
||||
if (!StringUtils.isBlank(ownerUdid)) {
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.storage.energy;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import reborncore.api.blockentity.IUpgrade;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BuiltScreenHandler;
|
||||
|
@ -76,10 +76,10 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
|
|||
}
|
||||
|
||||
public ItemStack getDropWithNBT() {
|
||||
CompoundTag blockEntity = new CompoundTag();
|
||||
NbtCompound blockEntity = new NbtCompound();
|
||||
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
|
||||
toTag(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
writeNbt(blockEntity);
|
||||
dropStack.setTag(new NbtCompound());
|
||||
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
|
||||
return dropStack;
|
||||
}
|
||||
|
@ -137,15 +137,15 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tagCompound.putInt("output", OUTPUT);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
|
||||
super.fromTag(blockState, nbttagcompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound nbttagcompound) {
|
||||
super.readNbt(blockState, nbttagcompound);
|
||||
this.OUTPUT = nbttagcompound.getInt("output");
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.blockentity.storage.energy.idsu;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.PersistentState;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -59,14 +59,14 @@ public class IDSUManager extends PersistentState {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(CompoundTag tag) {
|
||||
public void fromNbt(NbtCompound tag) {
|
||||
for (String uuid : tag.getKeys()) {
|
||||
playerHashMap.put(uuid, new IDSUPlayer(tag.getCompound(uuid)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tag) {
|
||||
public NbtCompound writeNbt(NbtCompound tag) {
|
||||
playerHashMap.forEach((uuid, player) -> tag.put(uuid, player.write()));
|
||||
return tag;
|
||||
}
|
||||
|
@ -78,20 +78,20 @@ public class IDSUManager extends PersistentState {
|
|||
private IDSUPlayer() {
|
||||
}
|
||||
|
||||
private IDSUPlayer(CompoundTag compoundTag) {
|
||||
private IDSUPlayer(NbtCompound compoundTag) {
|
||||
read(compoundTag);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public CompoundTag write() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
public NbtCompound write() {
|
||||
NbtCompound tag = new NbtCompound();
|
||||
tag.putDouble("energy", energy);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(@NotNull CompoundTag tag) {
|
||||
public void read(@NotNull NbtCompound tag) {
|
||||
energy = tag.getDouble("energy");
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.blockentity.storage.energy.idsu;
|
|||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import reborncore.client.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BuiltScreenHandler;
|
||||
|
@ -96,14 +96,14 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
|
||||
super.fromTag(blockState, nbttagcompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound nbttagcompound) {
|
||||
super.readNbt(blockState, nbttagcompound);
|
||||
this.ownerUdid = nbttagcompound.getString("ownerUdid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag nbttagcompound) {
|
||||
super.toTag(nbttagcompound);
|
||||
public NbtCompound writeNbt(NbtCompound nbttagcompound) {
|
||||
super.writeNbt(nbttagcompound);
|
||||
if (ownerUdid == null || StringUtils.isEmpty(ownerUdid)) {
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.storage.fluid;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
@ -76,9 +76,9 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
|
|||
|
||||
public ItemStack getDropWithNBT() {
|
||||
ItemStack dropStack = new ItemStack(getBlockType(), 1);
|
||||
final CompoundTag blockEntity = new CompoundTag();
|
||||
this.toTag(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
final NbtCompound blockEntity = new NbtCompound();
|
||||
this.writeNbt(blockEntity);
|
||||
dropStack.setTag(new NbtCompound());
|
||||
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
|
||||
return dropStack;
|
||||
}
|
||||
|
@ -115,8 +115,8 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, final NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
if (tagCompound.contains("unitType")) {
|
||||
this.type = TRContent.TankUnit.valueOf(tagCompound.getString("unitType"));
|
||||
configureEntity(type);
|
||||
|
@ -125,8 +125,8 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(final CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(final NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
tagCompound.putString("unitType", this.type.name());
|
||||
tank.write(tagCompound);
|
||||
return tagCompound;
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
@ -285,8 +285,8 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState blockState, CompoundTag tagCompound) {
|
||||
super.fromTag(blockState, tagCompound);
|
||||
public void readNbt(BlockState blockState, NbtCompound tagCompound) {
|
||||
super.readNbt(blockState, tagCompound);
|
||||
|
||||
if (tagCompound.contains("unitType")) {
|
||||
this.type = TRContent.StorageUnit.valueOf(tagCompound.getString("unitType"));
|
||||
|
@ -298,7 +298,7 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
storeItemStack = ItemStack.EMPTY;
|
||||
|
||||
if (tagCompound.contains("storedStack")) {
|
||||
storeItemStack = ItemStack.fromTag(tagCompound.getCompound("storedStack"));
|
||||
storeItemStack = ItemStack.fromNbt(tagCompound.getCompound("storedStack"));
|
||||
}
|
||||
|
||||
if (!storeItemStack.isEmpty()) {
|
||||
|
@ -311,15 +311,15 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
}
|
||||
|
||||
if (tagCompound.contains("lockedItem")) {
|
||||
lockedItemStack = ItemStack.fromTag(tagCompound.getCompound("lockedItem"));
|
||||
lockedItemStack = ItemStack.fromNbt(tagCompound.getCompound("lockedItem"));
|
||||
}
|
||||
|
||||
inventory.read(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag tagCompound) {
|
||||
super.toTag(tagCompound);
|
||||
public NbtCompound writeNbt(NbtCompound tagCompound) {
|
||||
super.writeNbt(tagCompound);
|
||||
|
||||
tagCompound.putString("unitType", this.type.name());
|
||||
|
||||
|
@ -328,7 +328,7 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
if (storeItemStack.getCount() > storeItemStack.getMaxCount()) {
|
||||
temp.setCount(storeItemStack.getMaxCount());
|
||||
}
|
||||
tagCompound.put("storedStack", temp.toTag(new CompoundTag()));
|
||||
tagCompound.put("storedStack", temp.writeNbt(new NbtCompound()));
|
||||
tagCompound.putInt("storedQuantity", Math.min(storeItemStack.getCount(), maxCapacity));
|
||||
} else {
|
||||
tagCompound.putInt("storedQuantity", 0);
|
||||
|
@ -338,7 +338,7 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
tagCompound.putInt("totalStoredAmount", getCurrentCapacity());
|
||||
|
||||
if (isLocked()) {
|
||||
tagCompound.put("lockedItem", lockedItemStack.toTag(new CompoundTag()));
|
||||
tagCompound.put("lockedItem", lockedItemStack.writeNbt(new NbtCompound()));
|
||||
}
|
||||
|
||||
inventory.write(tagCompound);
|
||||
|
@ -408,10 +408,10 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
@Override
|
||||
public ItemStack getToolDrop(PlayerEntity entityPlayer) {
|
||||
ItemStack dropStack = new ItemStack(getBlockType(), 1);
|
||||
final CompoundTag blockEntity = new CompoundTag();
|
||||
final NbtCompound blockEntity = new NbtCompound();
|
||||
|
||||
this.toTag(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
this.writeNbt(blockEntity);
|
||||
dropStack.setTag(new NbtCompound());
|
||||
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
|
||||
|
||||
return dropStack;
|
||||
|
@ -492,13 +492,13 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
this.serverCapacity = maxCapacity;
|
||||
}
|
||||
|
||||
public CompoundTag getStoredStackNBT() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
getStoredStack().toTag(tag);
|
||||
public NbtCompound getStoredStackNBT() {
|
||||
NbtCompound tag = new NbtCompound();
|
||||
getStoredStack().writeNbt(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setStoredStackFromNBT(CompoundTag tag) {
|
||||
storeItemStack = ItemStack.fromTag(tag);
|
||||
public void setStoredStackFromNBT(NbtCompound tag) {
|
||||
storeItemStack = ItemStack.fromNbt(tag);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,15 +27,15 @@ package techreborn.blocks.misc;
|
|||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FenceBlock;
|
||||
import net.minecraft.block.MapColor;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public class BlockRefinedIronFence extends FenceBlock {
|
||||
|
||||
public BlockRefinedIronFence() {
|
||||
super(FabricBlockSettings.of(Material.METAL, MaterialColor.WOOD).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL));
|
||||
super(FabricBlockSettings.of(Material.METAL, MapColor.OAK_TAN).strength(2.0F, 3.0F).sounds(BlockSoundGroup.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BlockRubberLog extends PillarBlock {
|
|||
public static BooleanProperty SHOULD_SAP = BooleanProperty.of("shouldsap");
|
||||
|
||||
public BlockRubberLog() {
|
||||
super(Settings.of(Material.WOOD, (blockState) -> MaterialColor.SPRUCE)
|
||||
super(Settings.of(Material.WOOD, (blockState) -> MapColor.SPRUCE_BROWN)
|
||||
.strength(2.0F, 2f)
|
||||
.sounds(BlockSoundGroup.WOOD)
|
||||
.ticksRandomly());
|
||||
|
|
|
@ -100,7 +100,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderBg(MatrixStack matrixStack, MinecraftClient mc, int mouseX, int mouseY) {
|
||||
public void renderBackground(MatrixStack matrixStack, MinecraftClient mc, int mouseX, int mouseY) {
|
||||
mc.getItemRenderer().renderInGuiWithOverrides(new ItemStack(Items.EXPERIENCE_BOTTLE), x, y);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.keybindings;
|
||||
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class KeyBindings {
|
||||
|
|
|
@ -30,9 +30,9 @@ import net.minecraft.client.render.entity.EntityRenderer;
|
|||
import net.minecraft.client.render.entity.TntMinecartEntityRenderer;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class NukeRenderer extends EntityRenderer<EntityNukePrimed> {
|
|||
matrixStack.scale(j, j, j);
|
||||
}
|
||||
|
||||
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-90.0F));
|
||||
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-90.0F));
|
||||
matrixStack.translate(-0.5D, -0.5D, 0.5D);
|
||||
TntMinecartEntityRenderer.renderFlashingBlock(TRContent.NUKE.getDefaultState(), matrixStack, vertexConsumerProvider, i, entity.getFuseTimer() / 5 % 2 == 0);
|
||||
matrixStack.pop();
|
||||
|
|
|
@ -33,9 +33,9 @@ import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ public class StorageUnitRenderer extends BlockEntityRenderer<StorageUnitBaseBloc
|
|||
// Item rendering
|
||||
matrices.push();
|
||||
Direction direction = storage.getFacing();
|
||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion((direction.getHorizontal() - 2) * 90F));
|
||||
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion((direction.getHorizontal() - 2) * 90F));
|
||||
matrices.scale(0.5F, 0.5F, 0.5F);
|
||||
switch (direction) {
|
||||
case NORTH:
|
||||
|
@ -85,7 +85,7 @@ public class StorageUnitRenderer extends BlockEntityRenderer<StorageUnitBaseBloc
|
|||
// Render item only on horizontal facing #2183
|
||||
if (Direction.Type.HORIZONTAL.test(facing) ){
|
||||
matrices.translate(0.5, 0.5, 0.5); // Translate center
|
||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90)); // Rotate depending on face
|
||||
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90)); // Rotate depending on face
|
||||
matrices.translate(0, 0, -0.505); // Translate forward
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ 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.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
import techreborn.blockentity.generator.basic.WindMillBlockEntity;
|
||||
|
||||
public class TurbineRenderer extends BlockEntityRenderer<WindMillBlockEntity> {
|
||||
|
@ -55,7 +55,7 @@ public class TurbineRenderer extends BlockEntityRenderer<WindMillBlockEntity> {
|
|||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0.5, 0, 0.5);
|
||||
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90));
|
||||
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90));
|
||||
matrixStack.translate(0, -1, -0.56);
|
||||
|
||||
float spin = blockEntity.bladeAngle + tickDelta * blockEntity.spinSpeed;
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ModRegistry {
|
|||
RebornRegistry.registerBlock(TRContent.RUBBER_BUTTON = InitUtils.setup(new RubberButtonBlock(), "rubber_button"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_PRESSURE_PLATE = InitUtils.setup(new RubberPressurePlateBlock(), "rubber_pressure_plate"), itemGroup);
|
||||
RebornRegistry.registerBlock(TRContent.RUBBER_DOOR = InitUtils.setup(new RubberDoorBlock(), "rubber_door"), itemGroup);
|
||||
RebornRegistry.registerBlockNoItem(TRContent.POTTED_RUBBER_SAPLING = InitUtils.setup(new FlowerPotBlock(TRContent.RUBBER_SAPLING, AbstractBlock.Settings.of(Material.SUPPORTED).breakInstantly().nonOpaque()), "potted_rubber_sapling"));
|
||||
RebornRegistry.registerBlockNoItem(TRContent.POTTED_RUBBER_SAPLING = InitUtils.setup(new FlowerPotBlock(TRContent.RUBBER_SAPLING, AbstractBlock.Settings.of(Material.DECORATION).breakInstantly().nonOpaque()), "potted_rubber_sapling"));
|
||||
|
||||
TechReborn.LOGGER.debug("TechReborns Blocks Loaded");
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TRRecipeHandler {
|
|||
if (!recipe.getId().getNamespace().equals(TechReborn.MOD_ID)) {
|
||||
return false;
|
||||
}
|
||||
return recipe.getPreviewInputs().stream().noneMatch(ingredient -> ingredient.test(TRContent.Parts.UU_MATTER.getStack()));
|
||||
return recipe.getIngredients().stream().noneMatch(ingredient -> ingredient.test(TRContent.Parts.UU_MATTER.getStack()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.fluid.Fluids;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
|
@ -231,7 +231,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
|
||||
@Override
|
||||
public Fluid getFluid(ItemStack itemStack) {
|
||||
CompoundTag tag = itemStack.getTag();
|
||||
NbtCompound tag = itemStack.getTag();
|
||||
if (tag != null && tag.contains("fluid")) {
|
||||
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
|
||||
}
|
||||
|
|
|
@ -115,8 +115,8 @@ public class ChainsawItem extends AxeItem implements EnergyHolder, ItemDurabilit
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isEffectiveOn(BlockState state) {
|
||||
return referenceTool.isEffectiveOn(state);
|
||||
public boolean isSuitableFor(BlockState state) {
|
||||
return referenceTool.isSuitableFor(state);
|
||||
}
|
||||
|
||||
// ItemDurabilityExtensions
|
||||
|
|
|
@ -135,7 +135,7 @@ public class DebugToolItem extends Item {
|
|||
MutableText s = new LiteralText("BlockEntity Tags:").formatted(Formatting.GREEN);
|
||||
|
||||
BlockDataObject bdo = new BlockDataObject(blockEntity, blockEntity.getPos());
|
||||
s.append(bdo.getTag().toText());
|
||||
s.append(bdo.getNbt().toText());
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class DrillItem extends PickaxeItem implements EnergyHolder, ItemDurabili
|
|||
// Going to remain to use this ol reliable function, the fabric one is funky
|
||||
|
||||
if (Energy.of(stack).getEnergy() >= cost) {
|
||||
if (stack.getItem().isEffectiveOn(state)) {
|
||||
if (stack.getItem().isSuitableFor(state)) {
|
||||
return poweredSpeed;
|
||||
} else {
|
||||
return Math.min(unpoweredSpeed * 10f, poweredSpeed); // Still be faster than unpowered when not effective
|
||||
|
@ -81,15 +81,15 @@ public class DrillItem extends PickaxeItem implements EnergyHolder, ItemDurabili
|
|||
|
||||
// PickaxeItem
|
||||
@Override
|
||||
public boolean isEffectiveOn(BlockState blockIn) {
|
||||
public boolean isSuitableFor(BlockState blockIn) {
|
||||
if(blockIn == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Items.DIAMOND_PICKAXE.isEffectiveOn(blockIn)) {
|
||||
if (Items.DIAMOND_PICKAXE.isSuitableFor(blockIn)) {
|
||||
return true;
|
||||
}
|
||||
if (Items.DIAMOND_SHOVEL.isEffectiveOn(blockIn)) {
|
||||
if (Items.DIAMOND_SHOVEL.isSuitableFor(blockIn)) {
|
||||
return true;
|
||||
}
|
||||
// More checks to fix #2225
|
||||
|
|
|
@ -66,13 +66,13 @@ public class AdvancedJackhammerItem extends JackhammerItem implements MultiBlock
|
|||
if (ToolsUtil.JackHammerSkippedBlocks(blockState)){
|
||||
return false;
|
||||
}
|
||||
return (stack.getItem().isEffectiveOn(blockState));
|
||||
return (stack.getItem().isSuitableFor(blockState));
|
||||
}
|
||||
|
||||
// JackhammerItem
|
||||
@Override
|
||||
public boolean postMine(ItemStack stack, World worldIn, BlockState stateIn, BlockPos pos, LivingEntity entityLiving) {
|
||||
if (!ItemUtils.isActive(stack) || !stack.getItem().isEffectiveOn(stateIn)) {
|
||||
if (!ItemUtils.isActive(stack) || !stack.getItem().isSuitableFor(stateIn)) {
|
||||
return super.postMine(stack, worldIn, stateIn, pos, entityLiving);
|
||||
}
|
||||
for (BlockPos additionalPos : ToolsUtil.getAOEMiningBlocks(worldIn, pos, entityLiving, 1)) {
|
||||
|
@ -109,7 +109,7 @@ public class AdvancedJackhammerItem extends JackhammerItem implements MultiBlock
|
|||
// MultiBlockBreakingTool
|
||||
@Override
|
||||
public Set<BlockPos> getBlocksToBreak(ItemStack stack, World worldIn, BlockPos pos, @Nullable LivingEntity entityLiving) {
|
||||
if (!stack.getItem().isEffectiveOn(worldIn.getBlockState(pos))) {
|
||||
if (!stack.getItem().isSuitableFor(worldIn.getBlockState(pos))) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
return ToolsUtil.getAOEMiningBlocks(worldIn, pos, entityLiving, 1, false)
|
||||
|
|
|
@ -60,8 +60,8 @@ public class RockCutterItem extends PickaxeItem implements EnergyHolder, ItemDur
|
|||
|
||||
// PickaxeItem
|
||||
@Override
|
||||
public boolean isEffectiveOn(BlockState state) {
|
||||
return Items.DIAMOND_PICKAXE.isEffectiveOn(state);
|
||||
public boolean isSuitableFor(BlockState state) {
|
||||
return Items.DIAMOND_PICKAXE.isSuitableFor(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,7 +94,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
return false;
|
||||
}
|
||||
|
||||
return (stack.getItem().isEffectiveOn(blockState));
|
||||
return (stack.getItem().isSuitableFor(blockState));
|
||||
}
|
||||
|
||||
private boolean isAOE5(ItemStack stack) {
|
||||
|
@ -104,7 +104,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
// JackhammerItem
|
||||
@Override
|
||||
public boolean postMine(ItemStack stack, World worldIn, BlockState stateIn, BlockPos pos, LivingEntity entityLiving) {
|
||||
if (!ItemUtils.isActive(stack) || !stack.getItem().isEffectiveOn(stateIn)) {
|
||||
if (!ItemUtils.isActive(stack) || !stack.getItem().isSuitableFor(stateIn)) {
|
||||
return super.postMine(stack, worldIn, stateIn, pos, entityLiving);
|
||||
}
|
||||
int radius = isAOE5(stack) ? 2 : 1;
|
||||
|
@ -160,7 +160,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
// MultiBlockBreakingTool
|
||||
@Override
|
||||
public Set<BlockPos> getBlocksToBreak(ItemStack stack, World worldIn, BlockPos pos, @Nullable LivingEntity entityLiving) {
|
||||
if (!stack.getItem().isEffectiveOn(worldIn.getBlockState(pos))) {
|
||||
if (!stack.getItem().isSuitableFor(worldIn.getBlockState(pos))) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
int radius = isAOE5(stack) ? 2 : 1;
|
||||
|
|
|
@ -36,7 +36,7 @@ import net.minecraft.entity.attribute.EntityAttributeModifier;
|
|||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -114,16 +114,16 @@ public class NanosaberItem extends SwordItem implements EnergyHolder, ItemDurabi
|
|||
return;
|
||||
}
|
||||
ItemStack inactiveUncharged = new ItemStack(this);
|
||||
inactiveUncharged.setTag(new CompoundTag());
|
||||
inactiveUncharged.setTag(new NbtCompound());
|
||||
inactiveUncharged.getOrCreateTag().putBoolean("isActive", false);
|
||||
|
||||
ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER);
|
||||
inactiveCharged.setTag(new CompoundTag());
|
||||
inactiveCharged.setTag(new NbtCompound());
|
||||
inactiveCharged.getOrCreateTag().putBoolean("isActive", false);
|
||||
Energy.of(inactiveCharged).set(Energy.of(inactiveCharged).getMaxStored());
|
||||
|
||||
ItemStack activeCharged = new ItemStack(TRContent.NANOSABER);
|
||||
activeCharged.setTag(new CompoundTag());
|
||||
activeCharged.setTag(new NbtCompound());
|
||||
activeCharged.getOrCreateTag().putBoolean("isActive", true);
|
||||
Energy.of(activeCharged).set(Energy.of(activeCharged).getMaxStored());
|
||||
|
||||
|
|
|
@ -75,10 +75,10 @@ public class OmniToolItem extends PickaxeItem implements EnergyHolder, ItemDurab
|
|||
|
||||
// PickaxeItem
|
||||
@Override
|
||||
public boolean isEffectiveOn(BlockState state) {
|
||||
return Items.DIAMOND_AXE.isEffectiveOn(state) || Items.DIAMOND_SWORD.isEffectiveOn(state)
|
||||
|| Items.DIAMOND_PICKAXE.isEffectiveOn(state) || Items.DIAMOND_SHOVEL.isEffectiveOn(state)
|
||||
|| Items.SHEARS.isEffectiveOn(state);
|
||||
public boolean isSuitableFor(BlockState state) {
|
||||
return Items.DIAMOND_AXE.isSuitableFor(state) || Items.DIAMOND_SWORD.isSuitableFor(state)
|
||||
|| Items.DIAMOND_PICKAXE.isSuitableFor(state) || Items.DIAMOND_SHOVEL.isSuitableFor(state)
|
||||
|| Items.SHEARS.isSuitableFor(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.multiblock.IMultiblockPart;
|
||||
|
@ -213,7 +213,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedPartWithMultiblockData(IMultiblockPart part, CompoundTag data) {
|
||||
public void onAttachedPartWithMultiblockData(IMultiblockPart part, NbtCompound data) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -302,22 +302,22 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void write(CompoundTag data) {
|
||||
public void write(NbtCompound data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(CompoundTag data) {
|
||||
public void read(NbtCompound data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void formatDescriptionPacket(CompoundTag data) {
|
||||
public void formatDescriptionPacket(NbtCompound data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeDescriptionPacket(CompoundTag data) {
|
||||
public void decodeDescriptionPacket(NbtCompound data) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ package techreborn.utils;
|
|||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.MapColor;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
|
@ -68,13 +68,13 @@ public class InitUtils {
|
|||
|
||||
public static AbstractBlock.Settings setupRubberBlockSettings(boolean noCollision, float hardness, float resistance) {
|
||||
|
||||
FabricBlockSettings settings = FabricBlockSettings.of(Material.WOOD, MaterialColor.SPRUCE);
|
||||
FabricBlockSettings settings = FabricBlockSettings.of(Material.WOOD, MapColor.SPRUCE_BROWN);
|
||||
settings.strength(hardness, resistance);
|
||||
settings.sounds(BlockSoundGroup.WOOD);
|
||||
if (noCollision) {
|
||||
settings.noCollision();
|
||||
}
|
||||
settings.materialColor(MaterialColor.SPRUCE);
|
||||
settings.materialColor(MapColor.SPRUCE_BROWN);
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RecipeUtils {
|
|||
}
|
||||
|
||||
public static boolean matchesSingleInput(Recipe<?> recipe, ItemStack input) {
|
||||
return recipe.getPreviewInputs().size() == 1 && recipe.getPreviewInputs().get(0).test(input);
|
||||
return recipe.getIngredients().size() == 1 && recipe.getIngredients().get(0).test(input);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue