More patch work, our async chunk loading doesn't appear to be viable for 1.13.

This commit is contained in:
LexManos committed 2018-12-05 18:08:27 -08:00
1 parent dd32e74e34
commit eb22f42fea
33 files changed
+750 -862

No files matched your search

@@ -31,6 +31,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EntitySpawnPlacementRegistry.SpawnPlacementType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.fluid.IFluidState;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -34,7 +34,6 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.HorseArmorType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.IItemPropertyGetter;
@@ -42,7 +41,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemUseContext;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumActionResult;
@@ -50,7 +48,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.registry.RegistrySimple;
import net.minecraft.world.GameType;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -329,16 +326,14 @@ public interface IForgeItem
* Determines if the specific ItemStack can be placed in the specified armor
* slot, for the entity.
*
* TODO: Change name to canEquip in 1.13?
*
* @param stack The ItemStack
* @param armorType Armor slot to be verified.
* @param entity The entity trying to equip the armor
* @return True if the given ItemStack can be inserted in the slot
*/
default boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity)
default boolean canEquip(ItemStack stack, EntityEquipmentSlot armorType, Entity entity)
{
return net.minecraft.entity.EntityLiving.getSlotForItemStack(stack) == armorType;
return EntityLiving.getSlotForItemStack(stack) == armorType;
}
/**
@@ -739,6 +734,7 @@ public interface IForgeItem
* @return an enum constant of type {@code HorseArmorType}. Return
* HorseArmorType.NONE if this is not horse armor
*/
@SuppressWarnings("deprecation")
default HorseArmorType getHorseArmorType(ItemStack stack)
{
return HorseArmorType.getByItem(stack.getItem());
@@ -26,16 +26,15 @@ import javax.annotation.Nullable;
import net.minecraft.block.state.BlockWorldState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.HorseArmorType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.nbt.NBTTagCompound;
@@ -145,7 +144,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
*/
default boolean onBlockStartBreak(BlockPos pos, EntityPlayer player)
{
return getStack().isEmpty() || getStack().getItem().onBlockStartBreak(getStack(), pos, player);
return !getStack().isEmpty() && getStack().getItem().onBlockStartBreak(getStack(), pos, player);
}
/**
@@ -300,4 +299,39 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
{
getStack().getItem().onHorseArmorTick(getStack(), world, horse);
}
/**
* Whether this Item can be used as a payment to activate the vanilla beacon.
*
* @return true if this Item can be used
*/
default boolean isBeaconPayment()
{
return getStack().getItem().isBeaconPayment(getStack());
}
/**
* Determines if the specific ItemStack can be placed in the specified armor
* slot, for the entity.
*
* @param armorType Armor slot to be verified.
* @param entity The entity trying to equip the armor
* @return True if the given ItemStack can be inserted in the slot
*/
default boolean canEquip(EntityEquipmentSlot armorType, Entity entity)
{
return getStack().getItem().canEquip(getStack(), armorType, entity);
}
/**
* Allow or forbid the specific book/item combination as an anvil enchant
*
* @param stack The item
* @param book The book
* @return if the enchantment is allowed
*/
default boolean isBookEnchantable(ItemStack book)
{
return getStack().getItem().isBookEnchantable(getStack(), book);
}
}