Regenerate patches with relative headers. This should lower conflicts in future PRs.

Convert Forge to use Official mappings.
Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive.
It is clear that their intent is to allow us to use their names for developing mods like this.
See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
This commit is contained in:
LexManos committed 2021-03-09 14:21:48 -08:00
1 parent 802298d99d
commit a95b968c13
832 files changed
+4464 -4373

No files matched your search

@@ -86,7 +86,7 @@ public interface IForgeBlock
*/
default float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity)
{
return getBlock().getSlipperiness();
return getBlock().getFriction();
}
/**
@@ -99,7 +99,7 @@ public interface IForgeBlock
*/
default int getLightValue(BlockState state, IBlockReader world, BlockPos pos)
{
return state.getLightValue();
return state.getLightEmission();
}
/**
@@ -113,7 +113,7 @@ public interface IForgeBlock
*/
default boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity)
{
return state.getBlock().isIn(BlockTags.CLIMBABLE);
return state.getBlock().is(BlockTags.CLIMBABLE);
}
/**
@@ -157,7 +157,7 @@ public interface IForgeBlock
default TileEntity createTileEntity(BlockState state, IBlockReader world)
{
if (getBlock() instanceof ITileEntityProvider)
return ((ITileEntityProvider)getBlock()).createNewTileEntity(world);
return ((ITileEntityProvider)getBlock()).newBlockEntity(world);
return null;
}
@@ -196,8 +196,8 @@ public interface IForgeBlock
*/
default boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest, FluidState fluid)
{
getBlock().onBlockHarvested(world, pos, state, player);
return world.setBlockState(pos, fluid.getBlockState(), world.isRemote ? 11 : 3);
getBlock().playerWillDestroy(world, pos, state, player);
return world.setBlock(pos, fluid.createLegacyBlock(), world.isClientSide ? 11 : 3);
}
/**
@@ -228,7 +228,7 @@ public interface IForgeBlock
*/
default boolean canCreatureSpawn(BlockState state, IBlockReader world, BlockPos pos, EntitySpawnPlacementRegistry.PlacementType type, @Nullable EntityType<?> entityType)
{
return state.canEntitySpawn(world, pos, entityType);
return state.isValidSpawn(world, pos, entityType);
}
/**
@@ -246,7 +246,7 @@ public interface IForgeBlock
{
if (world instanceof World)
{
return BedBlock.func_242652_a(entityType, world, pos, orientation);
return BedBlock.findStandUpPosition(entityType, world, pos, orientation);
}
return Optional.empty();
@@ -263,7 +263,7 @@ public interface IForgeBlock
*/
default void setBedOccupied(BlockState state, World world, BlockPos pos, LivingEntity sleeper, boolean occupied)
{
world.setBlockState(pos, state.with(BedBlock.OCCUPIED, occupied), 3);
world.setBlock(pos, state.setValue(BedBlock.OCCUPIED, occupied), 3);
}
/**
@@ -277,7 +277,7 @@ public interface IForgeBlock
*/
default Direction getBedDirection(BlockState state, IWorldReader world, BlockPos pos)
{
return state.get(HorizontalBlock.HORIZONTAL_FACING);
return state.getValue(HorizontalBlock.FACING);
}
/**
@@ -306,7 +306,7 @@ public interface IForgeBlock
*/
default boolean canBeReplacedByLeaves(BlockState state, IWorldReader world, BlockPos pos)
{
return isAir(state, world, pos) || state.isIn(BlockTags.LEAVES);
return isAir(state, world, pos) || state.is(BlockTags.LEAVES);
}
/**
@@ -319,8 +319,8 @@ public interface IForgeBlock
*/
default boolean canBeReplacedByLogs(BlockState state, IWorldReader world, BlockPos pos)
{
return (isAir(state, world, pos) || state.isIn(BlockTags.LEAVES)) || this == Blocks.GRASS_BLOCK || state.isIn(Tags.Blocks.DIRT)
|| getBlock().isIn(BlockTags.LOGS) || getBlock().isIn(BlockTags.SAPLINGS) || this == Blocks.VINE;
return (isAir(state, world, pos) || state.is(BlockTags.LEAVES)) || this == Blocks.GRASS_BLOCK || state.is(Tags.Blocks.DIRT)
|| getBlock().is(BlockTags.LOGS) || getBlock().is(BlockTags.SAPLINGS) || this == Blocks.VINE;
}
/**
@@ -348,7 +348,7 @@ public interface IForgeBlock
*/
default boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, @Nullable Direction side)
{
return state.canProvidePower() && side != null;
return state.isSignalSource() && side != null;
}
/**
@@ -360,7 +360,7 @@ public interface IForgeBlock
*/
default ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player)
{
return this.getBlock().getItem(world, pos, state);
return this.getBlock().getCloneItemStack(world, pos, state);
}
/**
@@ -469,8 +469,8 @@ public interface IForgeBlock
@Deprecated//TODO - 1.17: Remove (unused)
default void onPlantGrow(BlockState state, IWorld world, BlockPos pos, BlockPos source)
{
if (state.isIn(Tags.Blocks.DIRT))
world.setBlockState(pos, Blocks.DIRT.getDefaultState(), 2);
if (state.is(Tags.Blocks.DIRT))
world.setBlock(pos, Blocks.DIRT.defaultBlockState(), 2);
}
/**
@@ -484,8 +484,8 @@ public interface IForgeBlock
*/
default boolean isFertile(BlockState state, IBlockReader world, BlockPos pos)
{
if (state.isIn(Blocks.FARMLAND))
return state.get(FarmlandBlock.MOISTURE) > 0;
if (state.is(Blocks.FARMLAND))
return state.getValue(FarmlandBlock.MOISTURE) > 0;
return false;
}
@@ -516,7 +516,7 @@ public interface IForgeBlock
*/
default boolean isPortalFrame(BlockState state, IBlockReader world, BlockPos pos)
{
return state.isIn(Blocks.OBSIDIAN);
return state.is(Blocks.OBSIDIAN);
}
/**
@@ -546,7 +546,7 @@ public interface IForgeBlock
*/
default float getEnchantPowerBonus(BlockState state, IWorldReader world, BlockPos pos)
{
return state.isIn(Blocks.BOOKSHELF) ? 1: 0;
return state.is(Blocks.BOOKSHELF) ? 1: 0;
}
/**
@@ -578,7 +578,7 @@ public interface IForgeBlock
*/
default boolean shouldCheckWeakPower(BlockState state, IWorldReader world, BlockPos pos, Direction side)
{
return state.isNormalCube(world, pos);
return state.isRedstoneConductor(world, pos);
}
/**
@@ -644,7 +644,7 @@ public interface IForgeBlock
default float[] getBeaconColorMultiplier(BlockState state, IWorldReader world, BlockPos pos, BlockPos beaconPos)
{
if (getBlock() instanceof IBeaconBeamColorProvider)
return ((IBeaconBeamColorProvider)getBlock()).getColor().getColorComponentValues();
return ((IBeaconBeamColorProvider)getBlock()).getColor().getTextureDiffuseColors();
return null;
}
@@ -669,9 +669,9 @@ public interface IForgeBlock
if (entity instanceof LivingEntity)
{
LivingEntity ent = (LivingEntity)entity;
f12 = (float) EnchantmentHelper.getRespirationModifier(ent) * 0.2F;
f12 = (float) EnchantmentHelper.getRespiration(ent) * 0.2F;
if (ent.isPotionActive(Effects.WATER_BREATHING))
if (ent.hasEffect(Effects.WATER_BREATHING))
{
f12 = f12 * 0.3F + 0.6F;
}
@@ -755,7 +755,7 @@ public interface IForgeBlock
*/
default int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face)
{
return ((FireBlock)Blocks.FIRE).getFlammability(state);
return ((FireBlock)Blocks.FIRE).getBurnOdd(state);
}
/**
@@ -796,7 +796,7 @@ public interface IForgeBlock
*/
default int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face)
{
return ((FireBlock)Blocks.FIRE).getFireSpreadSpeed(state);
return ((FireBlock)Blocks.FIRE).getFlameOdds(state);
}
/**
@@ -812,7 +812,7 @@ public interface IForgeBlock
*/
default boolean isFireSource(BlockState state, IWorldReader world, BlockPos pos, Direction side)
{
return state.isIn(world.getDimensionType().isInfiniBurn());
return state.is(world.dimensionType().infiniburn());
}
/**
@@ -832,7 +832,7 @@ public interface IForgeBlock
else if ((entity instanceof WitherEntity) ||
(entity instanceof WitherSkullEntity))
{
return state.isAir(world, pos) || WitherEntity.canDestroyBlock(state);
return state.isAir(world, pos) || WitherEntity.canDestroy(state);
}
return true;
@@ -843,7 +843,7 @@ public interface IForgeBlock
*/
default boolean canDropFromExplosion(BlockState state, IBlockReader world, BlockPos pos, Explosion explosion)
{
return state.getBlock().canDropFromExplosion(explosion);
return state.getBlock().dropFromExplosion(explosion);
}
/**
@@ -863,8 +863,8 @@ public interface IForgeBlock
*/
default void onBlockExploded(BlockState state, World world, BlockPos pos, Explosion explosion)
{
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
getBlock().onExplosionDestroy(world, pos, explosion);
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
getBlock().wasExploded(world, pos, explosion);
}
/**
@@ -873,7 +873,7 @@ public interface IForgeBlock
*/
default boolean collisionExtendsVertically(BlockState state, IBlockReader world, BlockPos pos, Entity collidingEntity)
{
return getBlock().isIn(BlockTags.FENCES) || getBlock().isIn(BlockTags.WALLS) || getBlock() instanceof FenceGateBlock;
return getBlock().is(BlockTags.FENCES) || getBlock().is(BlockTags.WALLS) || getBlock() instanceof FenceGateBlock;
}
/**
@@ -921,6 +921,6 @@ public interface IForgeBlock
*/
default boolean isScaffolding(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity)
{
return state.isIn(Blocks.SCAFFOLDING);
return state.is(Blocks.SCAFFOLDING);
}
}
@@ -806,6 +806,6 @@ public interface IForgeBlockState
*/
default boolean isScaffolding(LivingEntity entity)
{
return getBlockState().getBlock().isScaffolding(getBlockState(), entity.world, entity.getPosition(), entity);
return getBlockState().getBlock().isScaffolding(getBlockState(), entity.level, entity.blockPosition(), entity);
}
}
@@ -106,6 +106,6 @@ public interface IForgeEffect {
* @return a value used to sort {@code PotionEffect}s in GUIs
*/
default int getGuiSortColor(EffectInstance potionEffect) {
return getEffect().getLiquidColor();
return getEffect().getColor();
}
}
@@ -43,7 +43,7 @@ public interface IForgeEffectInstance {
* @return true to display it (default), false to hide it.
*/
default boolean shouldRender() {
return getEffectInstance().getPotion().shouldRender(getEffectInstance());
return getEffectInstance().getEffect().shouldRender(getEffectInstance());
}
/**
@@ -51,7 +51,7 @@ public interface IForgeEffectInstance {
* @return true to draw the standard text
*/
default boolean shouldRenderInvText() {
return getEffectInstance().getPotion().shouldRenderInvText(getEffectInstance());
return getEffectInstance().getEffect().shouldRenderInvText(getEffectInstance());
}
/**
@@ -59,7 +59,7 @@ public interface IForgeEffectInstance {
* @return true to display it (default), false to hide it.
*/
default boolean shouldRenderHUD() {
return getEffectInstance().getPotion().shouldRenderHUD(getEffectInstance());
return getEffectInstance().getEffect().shouldRenderHUD(getEffectInstance());
}
/**
@@ -74,7 +74,7 @@ public interface IForgeEffectInstance {
*/
@OnlyIn(Dist.CLIENT)
default void renderInventoryEffect(DisplayEffectsScreen<?> gui, MatrixStack mStack, int x, int y, float z) {
getEffectInstance().getPotion().renderInventoryEffect(getEffectInstance(), gui, mStack, x, y, z);
getEffectInstance().getEffect().renderInventoryEffect(getEffectInstance(), gui, mStack, x, y, z);
}
/**
@@ -90,7 +90,7 @@ public interface IForgeEffectInstance {
*/
@OnlyIn(Dist.CLIENT)
default void renderHUDEffect(AbstractGui gui, MatrixStack mStack, int x, int y, float z, float alpha) {
getEffectInstance().getPotion().renderHUDEffect(getEffectInstance(), gui, mStack, x, y, z, alpha);
getEffectInstance().getEffect().renderHUDEffect(getEffectInstance(), gui, mStack, x, y, z, alpha);
}
/***
@@ -107,7 +107,7 @@ public interface IForgeEffectInstance {
* @return true if the given ItemStack is in the list of curative items for this PotionEffect, false otherwise
*/
default boolean isCurativeItem(ItemStack stack) {
return this.getCurativeItems().stream().anyMatch(e -> e.isItemEqual(stack));
return this.getCurativeItems().stream().anyMatch(e -> e.sameItem(stack));
}
/***
@@ -127,7 +127,7 @@ public interface IForgeEffectInstance {
default void writeCurativeItems(CompoundNBT nbt) {
ListNBT list = new ListNBT();
getCurativeItems().forEach(s -> list.add(s.write(new CompoundNBT())));
getCurativeItems().forEach(s -> list.add(s.save(new CompoundNBT())));
nbt.put("CurativeItems", list);
}
}
@@ -49,18 +49,18 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
default void deserializeNBT(CompoundNBT nbt)
{
getEntity().read(nbt);
getEntity().load(nbt);
}
default CompoundNBT serializeNBT()
{
CompoundNBT ret = new CompoundNBT();
String id = getEntity().getEntityString();
String id = getEntity().getEncodeId();
if (id != null)
{
ret.putString("id", getEntity().getEntityString());
ret.putString("id", getEntity().getEncodeId());
}
return getEntity().writeWithoutTypeId(ret);
return getEntity().saveWithoutId(ret);
}
boolean canUpdate();
@@ -101,7 +101,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
return new ItemStack(Items.LEAD);
else if (this instanceof ItemFrameEntity)
{
ItemStack held = ((ItemFrameEntity)this).getDisplayedItem();
ItemStack held = ((ItemFrameEntity)this).getItem();
if (held.isEmpty())
return new ItemStack(Items.ITEM_FRAME);
else
@@ -110,14 +110,14 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
else if (this instanceof AbstractMinecartEntity)
return ((AbstractMinecartEntity)this).getCartItem();
else if (this instanceof BoatEntity)
return new ItemStack(((BoatEntity)this).getItemBoat());
return new ItemStack(((BoatEntity)this).getDropItem());
else if (this instanceof ArmorStandEntity)
return new ItemStack(Items.ARMOR_STAND);
else if (this instanceof EnderCrystalEntity)
return new ItemStack(Items.END_CRYSTAL);
else
{
SpawnEggItem egg = SpawnEggItem.getEgg(getEntity().getType());
SpawnEggItem egg = SpawnEggItem.byId(getEntity().getType());
if (egg != null) return new ItemStack(egg);
}
return ItemStack.EMPTY;
@@ -142,7 +142,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
*/
default boolean canBeRiddenInWater(Entity rider)
{
return getEntity().canBeRiddenInWater();
return getEntity().rideableUnderWater();
}
/**
@@ -161,7 +161,7 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundNBT>
*/
default EntityClassification getClassification(boolean forSpawnCount)
{
return getEntity().getType().getClassification();
return getEntity().getType().getCategory();
}
/**
@@ -52,11 +52,11 @@ public interface IForgeEntityMinecart
*/
default BlockPos getCurrentRailPosition()
{
int x = MathHelper.floor(getMinecart().getPosX());
int y = MathHelper.floor(getMinecart().getPosY());
int z = MathHelper.floor(getMinecart().getPosZ());
int x = MathHelper.floor(getMinecart().getX());
int y = MathHelper.floor(getMinecart().getY());
int z = MathHelper.floor(getMinecart().getZ());
BlockPos pos = new BlockPos(x, y, z);
if (getMinecart().world.getBlockState(pos.down()).isIn(BlockTags.RAILS)) pos = pos.down();
if (getMinecart().level.getBlockState(pos.below()).is(BlockTags.RAILS)) pos = pos.below();
return pos;
}
@@ -56,7 +56,7 @@ public interface IForgeFluid
*/
default boolean isEntityInside(FluidState state, IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
{
return state.isTagged(tag) && yToTest < (double)(pos.getY() + state.getActualHeight(world, pos) + 0.11111111F);
return state.is(tag) && yToTest < (double)(pos.getY() + state.getHeight(world, pos) + 0.11111111F);
}
/**
@@ -52,7 +52,7 @@ public interface IForgeFluidState
default boolean isEntityInside(IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
{
// return ifluidstate.isTagged(p_213290_1_) && d0 < (double)((float)blockpos.getY() + ifluidstate.getActualHeight(this.world, blockpos) + 0.11111111F);
return getFluidState().getFluid().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
return getFluidState().getType().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
}
@@ -67,7 +67,7 @@ public interface IForgeFluidState
*/
default float getExplosionResistance(IBlockReader world, BlockPos pos, Explosion explosion)
{
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, explosion);
return getFluidState().getType().getExplosionResistance(getFluidState(), world, pos, explosion);
}
/**
@@ -74,7 +74,7 @@ public interface IForgeItem
@SuppressWarnings("deprecation")
default Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack)
{
return getItem().getAttributeModifiers(slot);
return getItem().getDefaultAttributeModifiers(slot);
}
/**
@@ -121,7 +121,7 @@ public interface IForgeItem
*/
default boolean isPiglinCurrency(ItemStack stack)
{
return stack.getItem() == PiglinTasks.field_234444_a_;
return stack.getItem() == PiglinTasks.BARTERING_ITEM;
}
/**
@@ -134,7 +134,7 @@ public interface IForgeItem
*/
default boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer)
{
return stack.getItem() instanceof ArmorItem && ((ArmorItem) stack.getItem()).getArmorMaterial() == ArmorMaterial.GOLD;
return stack.getItem() instanceof ArmorItem && ((ArmorItem) stack.getItem()).getMaterial() == ArmorMaterial.GOLD;
}
/**
@@ -244,7 +244,7 @@ public interface IForgeItem
{
return ItemStack.EMPTY;
}
return new ItemStack(getItem().getContainerItem());
return new ItemStack(getItem().getCraftingRemainingItem());
}
/**
@@ -256,7 +256,7 @@ public interface IForgeItem
@SuppressWarnings("deprecation")
default boolean hasContainerItem(ItemStack stack)
{
return getItem().hasContainerItem();
return getItem().hasCraftingRemainingItem();
}
/**
@@ -326,7 +326,7 @@ public interface IForgeItem
*/
default java.util.Collection<ItemGroup> getCreativeTabs()
{
return java.util.Collections.singletonList(getItem().getGroup());
return java.util.Collections.singletonList(getItem().getItemCategory());
}
/**
@@ -375,7 +375,7 @@ public interface IForgeItem
*/
default boolean canEquip(ItemStack stack, EquipmentSlotType armorType, Entity entity)
{
return MobEntity.getSlotForItemStack(stack) == armorType;
return MobEntity.getEquipmentSlotForItem(stack) == armorType;
}
/**
@@ -515,7 +515,7 @@ public interface IForgeItem
*/
default double getDurabilityForDisplay(ItemStack stack)
{
return (double) stack.getDamage() / (double) stack.getMaxDamage();
return (double) stack.getDamageValue() / (double) stack.getMaxDamage();
}
/**
@@ -528,7 +528,7 @@ public interface IForgeItem
*/
default int getRGBDurabilityForDisplay(ItemStack stack)
{
return MathHelper.hsvToRGB(Math.max(0.0F, (float) (1.0F - getDurabilityForDisplay(stack))) / 3.0F, 1.0F, 1.0F);
return MathHelper.hsvToRgb(Math.max(0.0F, (float) (1.0F - getDurabilityForDisplay(stack))) / 3.0F, 1.0F, 1.0F);
}
/**
@@ -553,7 +553,7 @@ public interface IForgeItem
*/
default boolean isDamaged(ItemStack stack)
{
return stack.getDamage() > 0;
return stack.getDamageValue() > 0;
}
/**
@@ -577,7 +577,7 @@ public interface IForgeItem
*/
default boolean canHarvestBlock(ItemStack stack, BlockState state)
{
return getItem().canHarvestBlock(state);
return getItem().isCorrectToolForDrops(state);
}
/**
@@ -615,7 +615,7 @@ public interface IForgeItem
*/
default int getItemEnchantability(ItemStack stack)
{
return getItem().getItemEnchantability();
return getItem().getEnchantmentValue();
}
/**
@@ -633,7 +633,7 @@ public interface IForgeItem
*/
default boolean canApplyAtEnchantingTable(ItemStack stack, net.minecraft.enchantment.Enchantment enchantment)
{
return enchantment.type.canEnchantItem(stack.getItem());
return enchantment.category.canEnchant(stack.getItem());
}
/**
@@ -662,8 +662,8 @@ public interface IForgeItem
*/
default boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack)
{
return !(newStack.getItem() == oldStack.getItem() && ItemStack.areItemStackTagsEqual(newStack, oldStack)
&& (newStack.isDamageable() || newStack.getDamage() == oldStack.getDamage()));
return !(newStack.getItem() == oldStack.getItem() && ItemStack.tagMatches(newStack, oldStack)
&& (newStack.isDamageableItem() || newStack.getDamageValue() == oldStack.getDamageValue()));
}
/**
@@ -677,7 +677,7 @@ public interface IForgeItem
*/
default boolean canContinueUsing(ItemStack oldStack, ItemStack newStack)
{
return ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack);
return ItemStack.isSameIgnoreDurability(oldStack, newStack);
}
/**
@@ -854,6 +854,6 @@ public interface IForgeItem
*/
default boolean isDamageable(ItemStack stack)
{
return this.getItem().isDamageable();
return this.getItem().canBeDepleted();
}
}
@@ -109,15 +109,15 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundNBT>
default ActionResultType onItemUseFirst(ItemUseContext context)
{
PlayerEntity entityplayer = context.getPlayer();
BlockPos blockpos = context.getPos();
CachedBlockInfo blockworldstate = new CachedBlockInfo(context.getWorld(), blockpos, false);
if (entityplayer != null && !entityplayer.abilities.allowEdit && !getStack().canPlaceOn(context.getWorld().getTags(), blockworldstate)) {
BlockPos blockpos = context.getClickedPos();
CachedBlockInfo blockworldstate = new CachedBlockInfo(context.getLevel(), blockpos, false);
if (entityplayer != null && !entityplayer.abilities.mayBuild && !getStack().hasAdventureModePlaceTagForBlock(context.getLevel().getTagManager(), blockworldstate)) {
return ActionResultType.PASS;
} else {
Item item = getStack().getItem();
ActionResultType enumactionresult = item.onItemUseFirst(getStack(), context);
if (entityplayer != null && enumactionresult == ActionResultType.SUCCESS) {
entityplayer.addStat(Stats.ITEM_USED.get(item));
entityplayer.awardStat(Stats.ITEM_USED.get(item));
}
return enumactionresult;
@@ -127,7 +127,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundNBT>
default CompoundNBT serializeNBT()
{
CompoundNBT ret = new CompoundNBT();
getStack().write(ret);
getStack().save(ret);
return ret;
}
/**
@@ -422,7 +422,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundNBT>
return other.isEmpty();
else
return !other.isEmpty() && getStack().getCount() == other.getCount() && getStack().getItem() == other.getItem() &&
(limitTags ? getStack().areShareTagsEqual(other) : ItemStack.areItemStackTagsEqual(getStack(), other));
(limitTags ? getStack().areShareTagsEqual(other) : ItemStack.tagMatches(getStack(), other));
}
/**
@@ -60,7 +60,7 @@ public interface IForgeStructure
default boolean getDefaultRestrictsSpawnsToInside()
{
//The Pillager Outpost and Ocean Monument check the full structure by default instead of limiting themselves to being within the structure's bounds
return getStructure() != Structure.PILLAGER_OUTPOST && getStructure() != Structure.MONUMENT;
return getStructure() != Structure.PILLAGER_OUTPOST && getStructure() != Structure.OCEAN_MONUMENT;
}
/**
@@ -44,7 +44,7 @@ public interface IForgeTagBuilder<T>
default TagsProvider.Builder<T> add(RegistryKey<T>... keys) {
TagsProvider.Builder<T> builder = getBuilder();
for (RegistryKey<T> key : keys) {
builder.getInternalBuilder().addItemEntry(key.getLocation(), getBuilder().getModID());
builder.getInternalBuilder().addElement(key.location(), getBuilder().getModID());
}
return builder;
}
@@ -51,14 +51,14 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
// @Override TODO re-evaluate
default void deserializeNBT(BlockState state, CompoundNBT nbt)
{
getTileEntity().read(state, nbt);
getTileEntity().load(state, nbt);
}
@Override
default CompoundNBT serializeNBT()
{
CompoundNBT ret = new CompoundNBT();
getTileEntity().write(ret);
getTileEntity().save(ret);
return ret;
}
@@ -82,7 +82,7 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
*/
default void handleUpdateTag(BlockState state, CompoundNBT tag)
{
getTileEntity().read(state, tag);
getTileEntity().load(state, tag);
}
/**
@@ -122,14 +122,14 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
AxisAlignedBB bb = INFINITE_EXTENT_AABB;
BlockState state = getTileEntity().getBlockState();
Block block = state.getBlock();
BlockPos pos = getTileEntity().getPos();
BlockPos pos = getTileEntity().getBlockPos();
if (block == Blocks.ENCHANTING_TABLE)
{
bb = new AxisAlignedBB(pos, pos.add(1, 1, 1));
bb = new AxisAlignedBB(pos, pos.offset(1, 1, 1));
}
else if (block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST)
{
bb = new AxisAlignedBB(pos.add(-1, 0, -1), pos.add(2, 2, 2));
bb = new AxisAlignedBB(pos.offset(-1, 0, -1), pos.offset(2, 2, 2));
}
else if (block == Blocks.STRUCTURE_BLOCK)
{
@@ -140,10 +140,10 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
AxisAlignedBB cbb = null;
try
{
VoxelShape collisionShape = state.getCollisionShape(getTileEntity().getWorld(), pos);
VoxelShape collisionShape = state.getCollisionShape(getTileEntity().getLevel(), pos);
if (!collisionShape.isEmpty())
{
cbb = collisionShape.getBoundingBox().offset(pos);
cbb = collisionShape.bounds().move(pos);
}
}
catch (Exception e)
@@ -154,7 +154,7 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
// So, once again in the long line of US having to accommodate BUKKIT breaking things,
// here it is, assume that the TE is only 1 cubic block. Problem with this is that it may
// cause the TileEntity renderer to error further down the line! But alas, nothing we can do.
cbb = new net.minecraft.util.math.AxisAlignedBB(pos.add(-1, 0, -1), pos.add(1, 1, 1));
cbb = new net.minecraft.util.math.AxisAlignedBB(pos.offset(-1, 0, -1), pos.offset(1, 1, 1));
}
if (cbb != null) bb = cbb;
}
@@ -168,8 +168,8 @@ public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
default void requestModelDataUpdate()
{
TileEntity te = getTileEntity();
World world = te.getWorld();
if (world != null && world.isRemote)
World world = te.getLevel();
if (world != null && world.isClientSide)
{
ModelDataManager.requestModelDataRefresh(te);
}