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

@@ -75,20 +75,19 @@ public class ForgeConfig
.translation("forge.configgui.fixVanillaCascading")
.define("fixVanillaCascading", false)
.comment("The time in ticks the server will wait when a dimension was queued to unload. This can be useful when rapidly loading and unloading dimensions, like e.g. throwing items through a nether portal a few time per second.")
.translation("forge.configgui.dimensionUnloadQueueDelay")
.defineInRange("dimensionUnloadQueueDelay", 0, 0, Integer.MAX_VALUE)
.comment("Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024")
.translation("forge.configgui.clumpingThreshold")
.worldRestart()
.defineInRange("clumpingThreshold", 64, 64, 1024)
.pop()
//Client
.comment("Client only settings, mostly things related to rendering")
.push("client")
.comment("Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024")
.translation("forge.configgui.clumpingThreshold")
.worldRestart()
.defineInRange("clumpingThreshold", 64, 64, 1024)
.comment("Toggle off to make missing model text in the gui fit inside the slot.")
.translation("forge.configgui.zoomInMissingModelTextInGui")
.define("zoomInMissingModelTextInGui", false)
@@ -149,8 +148,11 @@ public class ForgeConfig
public static double zombieBaseSummonChance() {
return ForgeConfig.INSTANCE.configData.<Double>getOrElse("general.zombieBaseSummonChance", (double)0.01F);
}
public static float zombieBabyChance() {
return ForgeConfig.INSTANCE.configData.<Float>getOrElse("general.zombieBabyChance", 0.05F);
public static double zombieBabyChance() {
return ForgeConfig.INSTANCE.configData.<Double>getOrElse("general.zombieBabyChance", 0.05D);
}
public static int clumpingThreshold() {
return ForgeConfig.INSTANCE.configData.<Integer>getOrElse("general.clumpingThreshold", 64);
}
}
@@ -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);
}
}
@@ -49,7 +49,7 @@ public class PlayerArmorInvWrapper extends RangedWrapper
}
}
// check if it's valid for the armor slot
if (equ != null && slot < 4 && !stack.isEmpty() && stack.getItem().isValidArmor(stack, equ, getInventoryPlayer().player))
if (equ != null && slot < 4 && !stack.isEmpty() && stack.canEquip(equ, getInventoryPlayer().player))
{
return super.insertItem(slot, stack, simulate);
}