mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 10:34:49 +00:00
Merge remote-tracking branch 'origin/1.14.x' into 1.14.x
This commit is contained in:
17 files changed
+116
-38
No files matched your search
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
|
||||
+++ b/net/minecraft/client/renderer/entity/layers/ArmorLayer.java
|
||||
@@ -55,12 +55,13 @@
|
||||
@@ -55,24 +55,25 @@
|
||||
ArmorItem armoritem = (ArmorItem)itemstack.func_77973_b();
|
||||
if (armoritem.func_185083_B_() == p_188361_9_) {
|
||||
A a = this.func_215337_a(p_188361_9_);
|
||||
@@ -16,7 +16,12 @@
|
||||
int i = ((DyeableArmorItem)armoritem).func_200886_f(itemstack);
|
||||
float f = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f1 = (float)(i >> 8 & 255) / 255.0F;
|
||||
@@ -72,7 +73,7 @@
|
||||
float f2 = (float)(i & 255) / 255.0F;
|
||||
GlStateManager.color4f(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e);
|
||||
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
|
||||
- this.func_215333_a(this.func_177178_a(armoritem, flag, "overlay"));
|
||||
+ this.func_215333_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay"));
|
||||
}
|
||||
|
||||
GlStateManager.color4f(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
|
||||
a.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_);
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
|
||||
} else {
|
||||
- simplebakedmodel$builder.func_177650_a(p_217644_4_.func_188048_b().func_177523_a(blockpartface.field_178244_b), func_217645_a(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
|
||||
+ simplebakedmodel$builder.func_177650_a(p_217644_4_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(direction)).orElse(direction), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
|
||||
+ simplebakedmodel$builder.func_177650_a(p_217644_4_.getState().apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(blockpartface.field_178244_b)).orElse(blockpartface.field_178244_b), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, p_217644_4_));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,3 +26,11 @@
|
||||
p_212854_2_.func_219897_b();
|
||||
return modelbakery;
|
||||
}
|
||||
@@ -47,6 +53,7 @@
|
||||
p_212853_1_.func_217844_a(p_212853_3_);
|
||||
this.field_174958_a = p_212853_1_.func_217846_a();
|
||||
this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, (net.minecraftforge.client.model.ModelLoader) p_212853_1_);
|
||||
p_212853_3_.func_219895_b("cache");
|
||||
this.field_174957_c.func_178124_c();
|
||||
p_212853_3_.func_76319_b();
|
||||
@@ -1,14 +1,5 @@
|
||||
--- a/net/minecraft/item/crafting/ArmorDyeRecipe.java
|
||||
+++ b/net/minecraft/item/crafting/ArmorDyeRecipe.java
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
itemstack = itemstack1;
|
||||
} else {
|
||||
- if (!(itemstack1.func_77973_b() instanceof DyeItem)) {
|
||||
+ if (!(itemstack.func_77973_b() instanceof DyeItem)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
--- a/net/minecraft/util/math/shapes/EntitySelectionContext.java
|
||||
+++ b/net/minecraft/util/math/shapes/EntitySelectionContext.java
|
||||
@@ -18,6 +18,11 @@
|
||||
private final Item field_216382_d;
|
||||
|
||||
protected EntitySelectionContext(boolean p_i51181_1_, double p_i51181_2_, Item p_i51181_4_) {
|
||||
+ this(null, p_i51181_1_, p_i51181_2_, p_i51181_4_);
|
||||
+ }
|
||||
+
|
||||
+ protected EntitySelectionContext(@javax.annotation.Nullable Entity entityIn, boolean p_i51181_1_, double p_i51181_2_, Item p_i51181_4_) {
|
||||
+ this.entity = entityIn;
|
||||
this.field_216380_b = p_i51181_1_;
|
||||
this.field_216381_c = p_i51181_2_;
|
||||
this.field_216382_d = p_i51181_4_;
|
||||
@@ -25,7 +30,7 @@
|
||||
|
||||
@Deprecated
|
||||
protected EntitySelectionContext(Entity p_i51182_1_) {
|
||||
- this(p_i51182_1_.func_70093_af(), p_i51182_1_.func_174813_aQ().field_72338_b, p_i51182_1_ instanceof LivingEntity ? ((LivingEntity)p_i51182_1_).func_184614_ca().func_77973_b() : Items.field_190931_a);
|
||||
+ this(p_i51182_1_, p_i51182_1_.func_70093_af(), p_i51182_1_.func_174813_aQ().field_72338_b, p_i51182_1_ instanceof LivingEntity ? ((LivingEntity)p_i51182_1_).func_184614_ca().func_77973_b() : Items.field_190931_a);
|
||||
}
|
||||
|
||||
public boolean func_216375_a(Item p_216375_1_) {
|
||||
@@ -39,4 +44,11 @@
|
||||
public boolean func_216378_a(VoxelShape p_216378_1_, BlockPos p_216378_2_, boolean p_216378_3_) {
|
||||
return this.field_216381_c > (double)p_216378_2_.func_177956_o() + p_216378_1_.func_197758_c(Direction.Axis.Y) - (double)1.0E-5F;
|
||||
}
|
||||
+
|
||||
+ private final @javax.annotation.Nullable Entity entity;
|
||||
+
|
||||
+ @Override
|
||||
+ public @javax.annotation.Nullable Entity getEntity() {
|
||||
+ return entity;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/util/math/shapes/ISelectionContext.java
|
||||
+++ b/net/minecraft/util/math/shapes/ISelectionContext.java
|
||||
@@ -4,7 +4,7 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
-public interface ISelectionContext {
|
||||
+public interface ISelectionContext extends net.minecraftforge.common.extensions.IForgeSelectionContext {
|
||||
static ISelectionContext func_216377_a() {
|
||||
return EntitySelectionContext.field_216379_a;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ public class ForgeHooksClient
|
||||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(fogRenderer, renderer, info, partial, mode, distance));
|
||||
}
|
||||
|
||||
public static void onModelBake(ModelManager modelManager, Map<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
public static void onModelBake(ModelManager modelManager, Map<ResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader));
|
||||
modelLoader.onPostBakeEvent(modelRegistry);
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.Map;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ModelManager;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
/**
|
||||
@@ -34,10 +35,10 @@ import net.minecraftforge.client.model.ModelLoader;
|
||||
public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event
|
||||
{
|
||||
private final ModelManager modelManager;
|
||||
private final Map<ModelResourceLocation, IBakedModel> modelRegistry;
|
||||
private final Map<ResourceLocation, IBakedModel> modelRegistry;
|
||||
private final ModelLoader modelLoader;
|
||||
|
||||
public ModelBakeEvent(ModelManager modelManager, Map<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
public ModelBakeEvent(ModelManager modelManager, Map<ResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
this.modelManager = modelManager;
|
||||
this.modelRegistry = modelRegistry;
|
||||
@@ -49,7 +50,7 @@ public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event
|
||||
return modelManager;
|
||||
}
|
||||
|
||||
public Map<ModelResourceLocation, IBakedModel> getModelRegistry()
|
||||
public Map<ResourceLocation, IBakedModel> getModelRegistry()
|
||||
{
|
||||
return modelRegistry;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@ public class RenderGameOverlayEvent extends Event
|
||||
{
|
||||
return partialTicks;
|
||||
}
|
||||
|
||||
public MainWindow getWindow()
|
||||
{
|
||||
return window;
|
||||
}
|
||||
|
||||
public ElementType getType()
|
||||
{
|
||||
@@ -66,17 +71,20 @@ public class RenderGameOverlayEvent extends Event
|
||||
}
|
||||
|
||||
private final float partialTicks;
|
||||
private final MainWindow window;
|
||||
private final ElementType type;
|
||||
|
||||
public RenderGameOverlayEvent(float partialTicks, MainWindow resolution)
|
||||
public RenderGameOverlayEvent(float partialTicks, MainWindow window)
|
||||
{
|
||||
this.partialTicks = partialTicks;
|
||||
this.window = window;
|
||||
this.type = null;
|
||||
}
|
||||
|
||||
private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
this.partialTicks = parent.getPartialTicks();
|
||||
this.window = parent.getWindow();
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@@ -943,7 +943,7 @@ public final class ModelLoader extends ModelBakery
|
||||
/**
|
||||
* Internal, do not use.
|
||||
*/
|
||||
public void onPostBakeEvent(Map<ModelResourceLocation, IBakedModel> modelRegistry)
|
||||
public void onPostBakeEvent(Map<ResourceLocation, IBakedModel> modelRegistry)
|
||||
{
|
||||
IBakedModel missingModel = modelRegistry.get(MODEL_MISSING);
|
||||
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IForgeSelectionContext
|
||||
{
|
||||
default @Nullable Entity getEntity()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -80,3 +80,5 @@ net/minecraft/world/storage/loot/LootEntryEmpty.<init>(II[Lnet/minecraft/world/s
|
||||
net/minecraft/world/storage/loot/LootEntryItem.<init>(Lnet/minecraft/item/Item;II[Lnet/minecraft/world/storage/loot/functions/LootFunction;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46644_1_,p_i46644_2_,p_i46644_3_,p_i46644_4_,p_i46644_5_,entryName
|
||||
net/minecraft/world/storage/loot/LootEntryTable.<init>(Lnet/minecraft/util/ResourceLocation;II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46639_1_,p_i46639_2_,p_i46639_3_,p_i46639_4_,entryName
|
||||
net/minecraft/world/storage/loot/LootPool.<init>([Lnet/minecraft/world/storage/loot/LootEntry;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Lnet/minecraft/world/storage/loot/RandomValueRange;Lnet/minecraft/world/storage/loot/RandomValueRange;Ljava/lang/String;)V=|p_i46643_1_,p_i46643_2_,p_i46643_3_,p_i46643_4_
|
||||
|
||||
net/minecraft/util/shapes/EntitySelectionContext.<init>(Lnet/minecraft/entity/Entity;ZDLnet/minecraft/item/Item;)V=|entity,p_i51181_1_,p_i51181_2_,p_i51181_4_
|
||||
@@ -40,8 +40,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
@Mod(MaterialFogColorTest.MODID)
|
||||
@Mod.EventBusSubscriber
|
||||
//@Mod(MaterialFogColorTest.MODID)
|
||||
//@Mod.EventBusSubscriber
|
||||
public class MaterialFogColorTest
|
||||
{
|
||||
static final String MODID = "fog_color_in_material_test";
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PathNodeTypeTest
|
||||
|
||||
|
||||
@ObjectHolder(BLOCK_ID)
|
||||
private static final Block TEST_BLOCK = null;
|
||||
private static Block TEST_BLOCK = null;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Block> event)
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Mod("client_command_test")
|
||||
//@Mod("client_command_test")
|
||||
public class ClientCommandTest
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -25,35 +25,37 @@ import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.model.BasicState;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
//@Mod(modid = BlockstateRetextureTest.MODID, name = "BlockstateRetextureTest", version = BlockstateRetextureTest.VERSION, acceptableRemoteVersions = "*", clientSideOnly = true)
|
||||
@Mod(BlockstateRetextureTest.MODID)
|
||||
public class BlockstateRetextureTest
|
||||
{
|
||||
public static final String MODID = "forge_blockstate_retexture_test";
|
||||
public static final String VERSION = "1.0";
|
||||
static final boolean ENABLED = false;
|
||||
static final boolean ENABLED = true;
|
||||
|
||||
private static ResourceLocation fenceName = new ResourceLocation("minecraft", "fence");
|
||||
private static ModelResourceLocation fenceLocation = new ModelResourceLocation(fenceName, "east=true,north=false,south=false,west=true");
|
||||
private static ResourceLocation fenceName = new ResourceLocation("minecraft", "oak_fence");
|
||||
private static ModelResourceLocation fenceLocation = new ModelResourceLocation(fenceName, "east=true,north=false,south=false,waterlogged=false,west=true");
|
||||
private static ResourceLocation stoneName = new ResourceLocation("minecraft", "stone");
|
||||
private static ModelResourceLocation stoneLocation = new ModelResourceLocation(stoneName, "normal");
|
||||
private static ModelResourceLocation stoneLocation = new ModelResourceLocation(stoneName, "");
|
||||
|
||||
private static Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
|
||||
{
|
||||
assert location != null;
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
|
||||
return Minecraft.getInstance().getTextureMap().getAtlasSprite(location.toString());
|
||||
};
|
||||
|
||||
//@Mod.EventBusSubscriber(modid = MODID, value = Side.CLIENT)
|
||||
@Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT)
|
||||
public static class ClientEvents
|
||||
{
|
||||
@net.minecraftforge.eventbus.api.SubscribeEvent
|
||||
@@ -64,16 +66,16 @@ public class BlockstateRetextureTest
|
||||
return;
|
||||
}
|
||||
|
||||
IModel fence = ModelLoaderRegistry.getModelOrLogError(fenceLocation, "Error loading fence model");
|
||||
IModel stone = ModelLoaderRegistry.getModelOrLogError(stoneLocation, "Error loading planks model");
|
||||
IModel retexturedFence = fence.retexture(ImmutableMap.of("texture", "blocks/log_oak"));
|
||||
IModel retexturedStone = stone.retexture(ImmutableMap.of("all", "blocks/diamond_block"));
|
||||
IModel<?> fence = ModelLoaderRegistry.getModelOrLogError(fenceLocation, "Error loading fence model");
|
||||
IModel<?> stone = ModelLoaderRegistry.getModelOrLogError(stoneLocation, "Error loading stone model");
|
||||
IModel<?> retexturedFence = fence.retexture(ImmutableMap.of("texture", "blocks/log_oak"));
|
||||
IModel<?> retexturedStone = stone.retexture(ImmutableMap.of("all", "blocks/diamond_block"));
|
||||
|
||||
IBakedModel fenceResult = retexturedFence.bake(fence.getDefaultState(), DefaultVertexFormats.BLOCK, textureGetter);
|
||||
IBakedModel stoneResult = retexturedStone.bake(stone.getDefaultState(), DefaultVertexFormats.BLOCK, textureGetter);
|
||||
IBakedModel fenceResult = retexturedFence.bake(event.getModelLoader(), textureGetter, new BasicState(fence.getDefaultState(), true), DefaultVertexFormats.ITEM);
|
||||
IBakedModel stoneResult = retexturedStone.bake(event.getModelLoader(), textureGetter, new BasicState(stone.getDefaultState(), true), DefaultVertexFormats.ITEM);
|
||||
|
||||
event.getModelRegistry().putObject(fenceLocation, fenceResult);
|
||||
event.getModelRegistry().putObject(stoneLocation, stoneResult);
|
||||
event.getModelRegistry().put(fenceLocation, fenceResult);
|
||||
event.getModelRegistry().put(stoneLocation, ModelLoaderRegistry.getMissingModel().bake(event.getModelLoader(), textureGetter, new BasicState(TRSRTransformation.identity(), false), DefaultVertexFormats.ITEM));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ loaderVersion="[2.0,)"
|
||||
modId="forgedebugmodeldata"
|
||||
#[[mods]]
|
||||
# modId="forgedebugmodelloaderregistry"
|
||||
[[mods]]
|
||||
modId="forge_blockstate_retexture_test"
|
||||
[[mods]]
|
||||
modId="containertypetest"
|
||||
[[mods]]
|
||||
|
||||
Reference in new issue
Block a user