More error cleanup, reinstanted IForgeReigstryEntry.

The abstract class will be used as the default, and to enable delegates but we should keep it api simple by keeping the interface.
Removed some patches that didnt get removed in the rebase.
This commit is contained in:
LexManos committed 2018-09-05 20:06:18 -07:00
1 parent ff6fa2cfaf
commit 2798080f60
35 files changed
+200 -472

No files matched your search

@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java
@@ -78,7 +78,7 @@
if (field_179505_b.apply(this.field_151501_c.func_180495_p(blockpos)))
{
- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing"))
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b))
{
this.field_151501_c.func_175655_b(blockpos, false);
}
@@ -91,7 +91,7 @@
if (this.field_151501_c.func_180495_p(blockpos1).func_177230_c() == Blocks.field_150349_c)
{
- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing"))
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b))
{
this.field_151501_c.func_175718_b(2001, blockpos1, Block.func_149682_b(Blocks.field_150349_c));
this.field_151501_c.func_180501_a(blockpos1, Blocks.field_150346_d.func_176223_P(), 2);
@@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java
@@ -29,7 +29,7 @@
{
if (this.field_179496_a <= 0)
{
- if (!this.field_179504_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing"))
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179504_c.field_70170_p, this.field_179504_c))
{
return false;
}
@@ -94,6 +94,12 @@
world.func_180501_a(blockpos, Blocks.field_185773_cZ.func_176223_P(), 3);
flag = true;
}
+ else if (itemstack.func_77973_b() instanceof net.minecraftforge.common.IPlantable) {
+ if(((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlantType(world,blockpos) == net.minecraftforge.common.EnumPlantType.Crop) {
+ world.func_180501_a(blockpos, ((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlant(world,blockpos),3);
+ flag = true;
+ }
+ }
}
if (flag)
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/monster/EntityCreeper.java
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntityCreeper.java
@@ -265,7 +265,7 @@
{
if (!this.field_70170_p.field_72995_K)
{
- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing");
+ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this);
float f = this.func_70830_n() ? 2.0F : 1.0F;
this.field_70729_aU = true;
this.field_70170_p.func_72876_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_82226_g * f, flag);
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEvoker.java
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEvoker.java
@@ -369,7 +369,7 @@
{
return false;
}
- else if (!EntityEvoker.this.field_70170_p.func_82736_K().func_82766_b("mobGriefing"))
+ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(EntityEvoker.this.field_70170_p, EntityEvoker.this))
{
return false;
}
@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySilverfish.java
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySilverfish.java
@@ -184,7 +184,7 @@
{
Random random = this.field_75457_a.func_70681_au();
- if (this.field_75457_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing") && random.nextInt(10) == 0)
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75457_a.field_70170_p, this.field_75457_a) && random.nextInt(10) == 0)
{
this.field_179483_b = EnumFacing.func_176741_a(random);
BlockPos blockpos = (new BlockPos(this.field_75457_a.field_70165_t, this.field_75457_a.field_70163_u + 0.5D, this.field_75457_a.field_70161_v)).func_177972_a(this.field_179483_b);
@@ -273,7 +273,7 @@
if (iblockstate.func_177230_c() == Blocks.field_150418_aU)
{
- if (world.func_82736_K().func_82766_b("mobGriefing"))
+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, this.field_179464_a))
{
world.func_175655_b(blockpos1, true);
}
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/passive/EntityRabbit.java
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntityRabbit.java
@@ -551,7 +551,7 @@
{
if (this.field_179496_a <= 0)
{
- if (!this.field_179500_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing"))
+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179500_c.field_70170_p, this.field_179500_c))
{
return false;
}
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java
@@ -40,7 +40,7 @@
this.func_174815_a(this.field_70235_a, p_70227_1_.field_72308_g);
}
- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing");
+ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a);
this.field_70170_p.func_72885_a((Entity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_92057_e, flag, flag);
this.func_70106_y();
}
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java
@@ -57,7 +57,7 @@
if (this.field_70235_a != null && this.field_70235_a instanceof EntityLiving)
{
- flag1 = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing");
+ flag1 = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a);
}
if (flag1)
@@ -0,0 +1,21 @@
--- a/net/minecraft/item/crafting/IRecipe.java
+++ b/net/minecraft/item/crafting/IRecipe.java
@@ -9,7 +9,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
-public interface IRecipe {
+public interface IRecipe extends net.minecraftforge.registries.IForgeRegistryEntry<IRecipe> {
boolean matches(IInventory inv, World worldIn);
ItemStack getCraftingResult(IInventory inv);
@@ -48,4 +48,9 @@
ResourceLocation func_199560_c();
IRecipeSerializer<?> func_199559_b();
+
+ @Override
+ default Class<IRecipe> getRegistryType() {
+ return IRecipe.class;
}
+}