1.19.3 port (#3074)
* Start on 1.19.3 port * Client runs, kinda * Fix crash when opening item group * Fix dynamic models * Add atlas config for slot sprites * Ore :) * Rubber tree's, lakes and ore cleanup * Add blocks to item group * Fix rubber tree sapling * added vanilla creative and missing peridot pickaxe (#3076) * added vanilla creative and missing peridot pickaxe * some small tweaks Co-authored-by: ayutac <fly.high.android@gmail.com> * added bamboo saw mill datagen recipes (#3077) * added bamboo saw mill datagen recipes * fixed datagen error Co-authored-by: ayutac <fly.high.android@gmail.com> * 1.19.3-rc1 * 1.19.3 port villager housing (#3082) * added NBTs for the houses * added the houses, theoretically * added the houses, practically * made house gen configurable Co-authored-by: ayutac <fly.high.android@gmail.com> * Fixes #3083 * reordered TR creative tab and small tweaks to the rest (#3081) * reordered TR creative tab and small tweaks to the rest * small bugfix Co-authored-by: ayutac <fly.high.android@gmail.com> * 1.19.3 * Bump version Co-authored-by: Ayutac <skoch02@students.uni-mainz.de> Co-authored-by: ayutac <fly.high.android@gmail.com>
This commit is contained in:
parent
7b7fba96c5
commit
573ba92920
162 changed files with 2049 additions and 1265 deletions
|
@ -28,20 +28,16 @@ import net.minecraft.client.item.TooltipContext;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -51,7 +47,7 @@ public class BatteryItem extends Item implements RcEnergyItem {
|
|||
private final RcEnergyTier tier;
|
||||
|
||||
public BatteryItem(int maxEnergy, RcEnergyTier tier) {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
|
||||
super(new Item.Settings().maxCount(1));
|
||||
this.maxEnergy = maxEnergy;
|
||||
this.tier = tier;
|
||||
}
|
||||
|
@ -86,14 +82,6 @@ public class BatteryItem extends Item implements RcEnergyItem {
|
|||
ItemUtils.buildActiveTooltip(stack, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, stacks);
|
||||
}
|
||||
|
||||
// EnergyHolder
|
||||
@Override
|
||||
public long getEnergyCapacity() {
|
||||
|
|
|
@ -40,25 +40,23 @@ import net.minecraft.fluid.FlowableFluid;
|
|||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUsage;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.tag.FluidTags;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
@ -68,7 +66,6 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.common.fluid.FluidUtils;
|
||||
import reborncore.common.fluid.container.ItemFluidInfo;
|
||||
import reborncore.common.util.ItemNBTHelper;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
/**
|
||||
|
@ -77,7 +74,7 @@ import techreborn.init.TRContent;
|
|||
public class DynamicCellItem extends Item implements ItemFluidInfo {
|
||||
|
||||
public DynamicCellItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(16));
|
||||
super(new Item.Settings().maxCount(16));
|
||||
}
|
||||
|
||||
// Thanks vanilla :)
|
||||
|
@ -90,7 +87,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
public static ItemStack getCellWithFluid(Fluid fluid, int stackSize) {
|
||||
Validate.notNull(fluid);
|
||||
ItemStack stack = new ItemStack(TRContent.CELL);
|
||||
ItemNBTHelper.getNBT(stack).putString("fluid", Registry.FLUID.getId(fluid).toString());
|
||||
ItemNBTHelper.getNBT(stack).putString("fluid", Registries.FLUID.getId(fluid).toString());
|
||||
stack.setCount(stackSize);
|
||||
return stack;
|
||||
}
|
||||
|
@ -148,19 +145,6 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup tab, DefaultedList<ItemStack> subItems) {
|
||||
if (!isIn(tab)) {
|
||||
return;
|
||||
}
|
||||
subItems.add(getEmptyCell(1));
|
||||
for (Fluid fluid : FluidUtils.getAllFluids()) {
|
||||
if (fluid.isStill(fluid.getDefaultState())) {
|
||||
subItems.add(getCellWithFluid(fluid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Text getName(ItemStack itemStack) {
|
||||
Fluid fluid = getFluid(itemStack);
|
||||
|
@ -253,7 +237,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
|
||||
private Fluid getFluid(@Nullable NbtCompound tag) {
|
||||
if (tag != null && tag.contains("fluid")) {
|
||||
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
|
||||
return Registries.FLUID.get(new Identifier(tag.getString("fluid")));
|
||||
}
|
||||
return Fluids.EMPTY;
|
||||
}
|
||||
|
|
|
@ -30,16 +30,19 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.GlobalPos;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.chunkloading.ChunkLoaderManager;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -47,7 +50,7 @@ import java.util.Optional;
|
|||
public class FrequencyTransmitterItem extends Item {
|
||||
|
||||
public FrequencyTransmitterItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
|
||||
super(new Item.Settings().maxCount(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,12 +35,11 @@ import net.minecraft.util.Hand;
|
|||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class GpsItem extends Item {
|
||||
|
||||
public GpsItem() {
|
||||
super(new Settings().group(TechReborn.ITEMGROUP));
|
||||
super(new Settings());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,13 +33,12 @@ import net.minecraft.util.Hand;
|
|||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.packets.ClientboundPackets;
|
||||
|
||||
public class ManualItem extends Item {
|
||||
|
||||
public ManualItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
|
||||
super(new Item.Settings().maxCount(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.List;
|
|||
public class ScrapBoxItem extends Item {
|
||||
|
||||
public ScrapBoxItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(new Item.Settings());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class UpgradeItem extends Item implements IUpgrade {
|
|||
public final IUpgrade behavior;
|
||||
|
||||
public UpgradeItem(String name, IUpgrade process) {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(16));
|
||||
super(new Item.Settings().maxCount(16));
|
||||
this.name = name;
|
||||
this.behavior = process;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.util.ActionResult;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
import techreborn.init.TRContent.StorageUnit;
|
||||
|
@ -19,7 +18,7 @@ import techreborn.init.TRContent.TankUnit;
|
|||
public class UpgraderItem extends Item {
|
||||
|
||||
public UpgraderItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(new Item.Settings());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,7 +36,6 @@ import net.minecraft.world.World;
|
|||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
public class BatpackItem extends ArmorItem implements RcEnergyItem {
|
||||
|
@ -45,7 +44,7 @@ public class BatpackItem extends ArmorItem implements RcEnergyItem {
|
|||
public final RcEnergyTier tier;
|
||||
|
||||
public BatpackItem(int maxCharge, ArmorMaterial material, RcEnergyTier tier) {
|
||||
super(material, EquipmentSlot.CHEST, new Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(material, EquipmentSlot.CHEST, new Settings().maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = maxCharge;
|
||||
this.tier = tier;
|
||||
}
|
||||
|
@ -71,14 +70,6 @@ public class BatpackItem extends ArmorItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, itemList);
|
||||
}
|
||||
|
||||
// EnergyHolder
|
||||
@Override
|
||||
public long getEnergyCapacity() {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class CloakingDeviceItem extends TRArmourItem implements RcEnergyItem, Ar
|
|||
|
||||
// 40M FE capacity with 10k FE\t charge rate
|
||||
public CloakingDeviceItem() {
|
||||
super(TRArmorMaterials.CLOAKING_DEVICE, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxDamage(-1).maxCount(1));
|
||||
super(TRArmorMaterials.CLOAKING_DEVICE, EquipmentSlot.CHEST, new Item.Settings().maxDamage(-1).maxCount(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,15 +77,6 @@ public class CloakingDeviceItem extends TRArmourItem implements RcEnergyItem, Ar
|
|||
return ItemUtils.getColorForDurabilityBar(stack);
|
||||
}
|
||||
|
||||
// Item
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, itemList);
|
||||
}
|
||||
|
||||
// EnergyHolder
|
||||
@Override
|
||||
public long getEnergyCapacity() {
|
||||
|
|
|
@ -37,17 +37,13 @@ import net.minecraft.entity.effect.StatusEffects;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import reborncore.api.items.ArmorBlockEntityTicker;
|
||||
import reborncore.api.items.ArmorRemoveHandler;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
public class QuantumSuitItem extends TRArmourItem implements ArmorBlockEntityTicker, ArmorRemoveHandler, RcEnergyItem {
|
||||
|
||||
|
@ -62,7 +58,7 @@ public class QuantumSuitItem extends TRArmourItem implements ArmorBlockEntityTic
|
|||
|
||||
|
||||
public QuantumSuitItem(ArmorMaterial material, EquipmentSlot slot) {
|
||||
super(material, slot, new Item.Settings().group(TechReborn.ITEMGROUP).maxDamage(-1).maxCount(1));
|
||||
super(material, slot, new Item.Settings().maxDamage(-1).maxCount(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -178,12 +174,4 @@ public class QuantumSuitItem extends TRArmourItem implements ArmorBlockEntityTic
|
|||
public RcEnergyTier getTier() {
|
||||
return RcEnergyTier.EXTREME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, itemList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import net.minecraft.entity.EquipmentSlot;
|
|||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -46,7 +45,7 @@ public class TRArmourItem extends ArmorItem {
|
|||
};
|
||||
|
||||
public TRArmourItem(ArmorMaterial material, EquipmentSlot slot) {
|
||||
this(material, slot, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
this(material, slot, new Item.Settings());
|
||||
}
|
||||
|
||||
public TRArmourItem(ArmorMaterial material, EquipmentSlot slot, Item.Settings settings) {
|
||||
|
|
|
@ -28,16 +28,16 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.tag.BlockTags;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.item.AxeItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
public class ChainsawItem extends AxeItem implements RcEnergyItem {
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class ChainsawItem extends AxeItem implements RcEnergyItem {
|
|||
|
||||
public ChainsawItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, Item referenceTool) {
|
||||
// combat stats same as for diamond axe. Fix for #2468
|
||||
super(material, 5.0F, -3.0F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(material, 5.0F, -3.0F, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
this.cost = cost;
|
||||
|
@ -112,14 +112,6 @@ public class ChainsawItem extends AxeItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, stacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBarStep(ItemStack stack) {
|
||||
return ItemUtils.getPowerForDurabilityBar(stack);
|
||||
|
|
|
@ -30,16 +30,15 @@ import net.minecraft.block.entity.BlockEntity;
|
|||
import net.minecraft.command.BlockDataObject;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import team.reborn.energy.api.EnergyStorage;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
@ -49,7 +48,7 @@ import java.util.Map.Entry;
|
|||
public class DebugToolItem extends Item {
|
||||
|
||||
public DebugToolItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(new Item.Settings());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -109,7 +108,7 @@ public class DebugToolItem extends Item {
|
|||
String s = "" + Formatting.GREEN;
|
||||
s += "Block Registry Name: ";
|
||||
s += Formatting.BLUE;
|
||||
s += Registry.BLOCK.getId(block);
|
||||
s += Registries.BLOCK.getId(block);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -29,20 +29,16 @@ import net.minecraft.enchantment.EnchantmentHelper;
|
|||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.MiningToolItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
public class DrillItem extends MiningToolItem implements RcEnergyItem {
|
||||
public final int maxCharge;
|
||||
|
@ -54,7 +50,7 @@ public class DrillItem extends MiningToolItem implements RcEnergyItem {
|
|||
|
||||
public DrillItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, MiningLevel miningLevel) {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(1, -2.8F, material, TRContent.BlockTags.DRILL_MINEABLE, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(1, -2.8F, material, TRContent.BlockTags.DRILL_MINEABLE, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
this.cost = cost;
|
||||
this.poweredSpeed = poweredSpeed;
|
||||
|
@ -125,14 +121,6 @@ public class DrillItem extends MiningToolItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, stacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBarStep(ItemStack stack) {
|
||||
return ItemUtils.getPowerForDurabilityBar(stack);
|
||||
|
|
|
@ -48,7 +48,7 @@ public class JackhammerItem extends PickaxeItem implements RcEnergyItem {
|
|||
|
||||
public JackhammerItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost) {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(material, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(material, 1, -2.8F, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
this.cost = cost;
|
||||
|
@ -111,14 +111,6 @@ public class JackhammerItem extends PickaxeItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, stacks);
|
||||
}
|
||||
|
||||
// EnergyHolder
|
||||
@Override
|
||||
public long getEnergyCapacity() {
|
||||
|
|
|
@ -39,6 +39,7 @@ import net.minecraft.util.ActionResult;
|
|||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blockentity.cable.CableBlockEntity;
|
||||
import techreborn.blocks.cable.CableBlock;
|
||||
|
@ -49,7 +50,7 @@ import java.util.List;
|
|||
public class PaintingToolItem extends Item {
|
||||
|
||||
public PaintingToolItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamageIfAbsent(64));
|
||||
super(new Item.Settings().maxCount(1).maxDamageIfAbsent(64));
|
||||
}
|
||||
|
||||
public ActionResult useOnBlock(ItemUsageContext context) {
|
||||
|
@ -69,7 +70,7 @@ public class PaintingToolItem extends Item {
|
|||
}
|
||||
return ActionResult.FAIL;
|
||||
} else {
|
||||
BlockState cover = getCover(context.getStack());
|
||||
BlockState cover = getCover(context.getWorld(), context.getStack());
|
||||
if (cover != null && blockState.getBlock() instanceof CableBlock && blockState.get(CableBlock.COVERED)) {
|
||||
BlockEntity blockEntity = context.getWorld().getBlockEntity(context.getBlockPos());
|
||||
if (blockEntity == null) {
|
||||
|
@ -89,15 +90,15 @@ public class PaintingToolItem extends Item {
|
|||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
public static BlockState getCover(ItemStack stack) {
|
||||
public static BlockState getCover(World world, ItemStack stack) {
|
||||
if (stack.hasNbt() && stack.getOrCreateNbt().contains("cover")) {
|
||||
return NbtHelper.toBlockState(stack.getOrCreateNbt().getCompound("cover"));
|
||||
return NbtHelper.toBlockState(WorldUtils.getBlockRegistryWrapper(world), stack.getOrCreateNbt().getCompound("cover"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
|
||||
BlockState blockState = getCover(stack);
|
||||
BlockState blockState = getCover(world, stack);
|
||||
if (blockState != null) {
|
||||
tooltip.add((Text.translatable(blockState.getBlock().getTranslationKey())).formatted(Formatting.GRAY));
|
||||
tooltip.add((Text.translatable("techreborn.tooltip.painting_tool.apply")).formatted(Formatting.GOLD));
|
||||
|
|
|
@ -25,11 +25,10 @@
|
|||
package techreborn.items.tool;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class TreeTapItem extends Item {
|
||||
|
||||
public TreeTapItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamageIfAbsent(20));
|
||||
super(new Item.Settings().maxCount(1).maxDamageIfAbsent(20));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IToolHandler;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 26/02/2016.
|
||||
|
@ -40,7 +39,7 @@ import techreborn.TechReborn;
|
|||
public class WrenchItem extends Item implements IToolHandler {
|
||||
|
||||
public WrenchItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
|
||||
super(new Item.Settings().maxCount(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ElectricTreetapItem extends Item implements RcEnergyItem {
|
|||
public RcEnergyTier tier = RcEnergyTier.MEDIUM;
|
||||
|
||||
public ElectricTreetapItem() {
|
||||
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
}
|
||||
|
||||
// Item
|
||||
|
@ -54,14 +54,6 @@ public class ElectricTreetapItem extends Item implements RcEnergyItem {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(this, stacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBarStep(ItemStack stack) {
|
||||
return ItemUtils.getPowerForDurabilityBar(stack);
|
||||
|
|
|
@ -29,16 +29,16 @@ import net.minecraft.enchantment.EnchantmentHelper;
|
|||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.PickaxeItem;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
|
||||
public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
|
||||
|
@ -49,7 +49,7 @@ public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
|
|||
// 10k Energy with 128 E\t charge rate
|
||||
public RockCutterItem() {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(TRToolMaterials.ROCK_CUTTER, 1, -2.8f, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(TRToolMaterials.ROCK_CUTTER, 1, -2.8f, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
}
|
||||
|
||||
// PickaxeItem
|
||||
|
@ -105,21 +105,6 @@ public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
|
||||
if (!isIn(group)) {
|
||||
return;
|
||||
}
|
||||
ItemStack uncharged = new ItemStack(this);
|
||||
uncharged.addEnchantment(Enchantments.SILK_TOUCH, 1);
|
||||
ItemStack charged = new ItemStack(TRContent.ROCK_CUTTER);
|
||||
charged.addEnchantment(Enchantments.SILK_TOUCH, 1);
|
||||
setStoredEnergy(charged, getEnergyCapacity());
|
||||
|
||||
stacks.add(uncharged);
|
||||
stacks.add(charged);
|
||||
}
|
||||
|
||||
// ItemDurabilityExtensions
|
||||
@Override
|
||||
public int getItemBarStep(ItemStack stack) {
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.entity.LivingEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.tag.BlockTags;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
|
|
|
@ -114,12 +114,4 @@ public class IndustrialDrillItem extends DrillItem {
|
|||
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
ItemUtils.buildActiveTooltip(stack, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup par2ItemGroup, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(par2ItemGroup)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(TRContent.INDUSTRIAL_DRILL, itemList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,23 +38,18 @@ import net.minecraft.entity.attribute.EntityAttributeModifier;
|
|||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.SwordItem;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -65,7 +60,7 @@ public class NanosaberItem extends SwordItem implements RcEnergyItem {
|
|||
|
||||
// 4ME max charge with 1k charge rate
|
||||
public NanosaberItem() {
|
||||
super(TRToolMaterials.NANOSABER, 1, 1, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(TRToolMaterials.NANOSABER, 1, 1, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
}
|
||||
|
||||
// SwordItem
|
||||
|
@ -106,31 +101,6 @@ public class NanosaberItem extends SwordItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(
|
||||
ItemGroup par2ItemGroup, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(par2ItemGroup)) {
|
||||
return;
|
||||
}
|
||||
ItemStack inactiveUncharged = new ItemStack(this);
|
||||
inactiveUncharged.setNbt(new NbtCompound());
|
||||
inactiveUncharged.getOrCreateNbt().putBoolean("isActive", false);
|
||||
|
||||
ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER);
|
||||
inactiveCharged.setNbt(new NbtCompound());
|
||||
inactiveCharged.getOrCreateNbt().putBoolean("isActive", false);
|
||||
setStoredEnergy(inactiveCharged, getEnergyCapacity());
|
||||
|
||||
ItemStack activeCharged = new ItemStack(TRContent.NANOSABER);
|
||||
activeCharged.setNbt(new NbtCompound());
|
||||
activeCharged.getOrCreateNbt().putBoolean("isActive", true);
|
||||
setStoredEnergy(activeCharged, getEnergyCapacity());
|
||||
|
||||
itemList.add(inactiveUncharged);
|
||||
itemList.add(inactiveCharged);
|
||||
itemList.add(activeCharged);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class OmniToolItem extends MiningToolItem implements RcEnergyItem {
|
|||
|
||||
// 4M FE max charge with 1k charge rate
|
||||
public OmniToolItem() {
|
||||
super(3, 1, TRToolMaterials.OMNI_TOOL, TRContent.BlockTags.OMNI_TOOL_MINEABLE, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(3, 1, TRToolMaterials.OMNI_TOOL, TRContent.BlockTags.OMNI_TOOL_MINEABLE, new Item.Settings().maxCount(1).maxDamage(-1));
|
||||
this.miningLevel = MiningLevel.DIAMOND.intLevel;
|
||||
}
|
||||
|
||||
|
@ -114,14 +114,6 @@ public class OmniToolItem extends MiningToolItem implements RcEnergyItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendStacks(ItemGroup par2ItemGroup, DefaultedList<ItemStack> itemList) {
|
||||
if (!isIn(par2ItemGroup)) {
|
||||
return;
|
||||
}
|
||||
InitUtils.initPoweredItems(TRContent.OMNI_TOOL, itemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBarStep(ItemStack stack) {
|
||||
return ItemUtils.getPowerForDurabilityBar(stack);
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class TRAxeItem extends AxeItem {
|
||||
|
||||
|
@ -40,7 +39,7 @@ public class TRAxeItem extends AxeItem {
|
|||
}
|
||||
|
||||
public TRAxeItem(ToolMaterial material, String repairOreDict) {
|
||||
super(material, material.getAttackDamage(), -3.0F, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(material, material.getAttackDamage(), -3.0F, new Item.Settings());
|
||||
this.repairOreDict = repairOreDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class TRHoeItem extends HoeItem {
|
|||
}
|
||||
|
||||
public TRHoeItem(ToolMaterial material, String repairOreDict) {
|
||||
super(material, 0, 0F, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(material, 0, 0F, new Item.Settings());
|
||||
this.repairOreDict = repairOreDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.PickaxeItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class TRPickaxeItem extends PickaxeItem {
|
||||
|
||||
|
@ -40,7 +39,7 @@ public class TRPickaxeItem extends PickaxeItem {
|
|||
}
|
||||
|
||||
public TRPickaxeItem(ToolMaterial material, String repairOreDict) {
|
||||
super(material, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(material, 1, -2.8F, new Item.Settings());
|
||||
this.repairOreDict = repairOreDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class TRSpadeItem extends ShovelItem {
|
|||
}
|
||||
|
||||
public TRSpadeItem(ToolMaterial material, String repairOreDict) {
|
||||
super(material, 1.5F, -3.0F, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(material, 1.5F, -3.0F, new Item.Settings());
|
||||
this.repairOreDict = repairOreDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.SwordItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class TRSwordItem extends SwordItem {
|
||||
|
||||
|
@ -40,7 +39,7 @@ public class TRSwordItem extends SwordItem {
|
|||
}
|
||||
|
||||
public TRSwordItem(ToolMaterial material, String repairOreDict) {
|
||||
super(material, 3, -2.4F, new Item.Settings().group(TechReborn.ITEMGROUP));
|
||||
super(material, 3, -2.4F, new Item.Settings());
|
||||
this.repairOreDict = repairOreDict;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue