Fix build script producing duplicated eclipse source folders.
Fix not including userdev source in sources jar. Update license header of files that need it. Delete patches_old folders. Most are unneeded in 1.13+ as the systems they effected were changed significantly. Any that need to be readdressed can be done as PRs.
This commit is contained in:
parent
d7949d5316
commit
eae0858de6
70 changed files with 178 additions and 2005 deletions
32
build.gradle
32
build.gradle
|
@ -23,6 +23,7 @@ import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
|
|||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
import java.util.stream.Collectors
|
||||
|
||||
|
@ -106,49 +107,54 @@ project(':forge') {
|
|||
apply plugin: 'de.undercouch.download'
|
||||
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
group = 'net.minecraftforge' //TODO: remove test when we finish patches and want users to find it
|
||||
group = 'net.minecraftforge'
|
||||
|
||||
sourceSets {
|
||||
fmllauncher {
|
||||
java {
|
||||
srcDir "$rootDir/src/fmllauncher/java"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/fmllauncher/resources"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/resources"]
|
||||
}
|
||||
}
|
||||
main {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/main/java"
|
||||
srcDirs = ["$rootDir/src/main/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/main/resources"
|
||||
srcDirs = ["$rootDir/src/main/resources"]
|
||||
}
|
||||
}
|
||||
test {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/test/java"
|
||||
srcDir "$rootDir/src/fmllaunchertest/java"
|
||||
srcDirs = [
|
||||
"$rootDir/src/test/java",
|
||||
"$rootDir/src/fmllaunchertest/java"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/test/resources"
|
||||
srcDirs = ["$rootDir/src/test/resources"]
|
||||
}
|
||||
}
|
||||
userdev {
|
||||
compileClasspath += sourceSets.main.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.main.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/userdev/java"
|
||||
srcDirs = ["$rootDir/src/userdev/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/userdev/resources"
|
||||
srcDirs = ["$rootDir/src/userdev/resources"]
|
||||
}
|
||||
}
|
||||
}
|
||||
//Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
|
||||
eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
|
@ -888,8 +894,12 @@ project(':forge') {
|
|||
}
|
||||
}
|
||||
|
||||
extractRangeMap {
|
||||
addDependencies jar.archivePath
|
||||
addSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
applyRangeMap {
|
||||
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
|
||||
setSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn('genEclipseRuns')
|
||||
|
|
|
@ -1,180 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java
|
||||
@@ -103,6 +103,21 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
+ loadBlock(blockstatemapper, block, resourcelocation);
|
||||
+ }
|
||||
+ catch (Exception exception)
|
||||
+ {
|
||||
+ field_177603_c.warn((String)("Unable to load definition " + resourcelocation), (Throwable)exception);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected void loadBlock(BlockStateMapper blockstatemapper, Block block, final ResourceLocation resourcelocation)
|
||||
+ {
|
||||
+ {
|
||||
+ {
|
||||
+ {
|
||||
ModelBlockDefinition modelblockdefinition = this.func_177586_a(resourcelocation);
|
||||
Map<IBlockState, ModelResourceLocation> map = blockstatemapper.func_188181_b(block);
|
||||
|
||||
@@ -115,7 +130,6 @@
|
||||
if (collection1 == null)
|
||||
{
|
||||
collection1 = Lists.<ModelResourceLocation>newArrayList();
|
||||
- this.field_188642_k.put(modelblockdefinition, collection1);
|
||||
}
|
||||
|
||||
collection1.addAll(Lists.newArrayList(Iterables.filter(collection, new Predicate<ModelResourceLocation>()
|
||||
@@ -125,6 +139,7 @@
|
||||
return resourcelocation.equals(p_apply_1_);
|
||||
}
|
||||
})));
|
||||
+ registerMultipartVariant(modelblockdefinition, collection1);
|
||||
}
|
||||
|
||||
for (Entry<IBlockState, ModelResourceLocation> entry : map.entrySet())
|
||||
@@ -135,22 +150,18 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
- this.field_177612_i.put(modelresourcelocation, modelblockdefinition.func_188004_c(modelresourcelocation.func_177518_c()));
|
||||
+ func_177569_a(modelblockdefinition, modelresourcelocation);
|
||||
}
|
||||
catch (RuntimeException var12)
|
||||
{
|
||||
if (!modelblockdefinition.func_188002_b())
|
||||
{
|
||||
- field_177603_c.warn("Unable to load variant: {} from {}", modelresourcelocation.func_177518_c(), modelresourcelocation);
|
||||
+ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
- catch (Exception exception)
|
||||
- {
|
||||
- field_177603_c.warn("Unable to load definition {}", resourcelocation, exception);
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +239,7 @@
|
||||
try
|
||||
{
|
||||
inputstream = p_188636_2_.func_110527_b();
|
||||
- lvt_4_1_ = ModelBlockDefinition.func_178331_a(new InputStreamReader(inputstream, StandardCharsets.UTF_8));
|
||||
+ lvt_4_1_ = ModelBlockDefinition.parseFromReader(new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_188636_1_);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -394,6 +405,7 @@
|
||||
|
||||
protected void func_177592_e()
|
||||
{
|
||||
+ this.field_177613_u.clear(); // FML clear this to prevent double ups.
|
||||
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150348_b), Lists.newArrayList("stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"));
|
||||
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150346_d), Lists.newArrayList("dirt", "coarse_dirt", "podzol"));
|
||||
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150344_f), Lists.newArrayList("oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"));
|
||||
@@ -441,6 +453,10 @@
|
||||
this.field_177613_u.put(Items.field_179570_aq, Lists.newArrayList("oak_door"));
|
||||
this.field_177613_u.put(Items.field_151124_az, Lists.newArrayList("oak_boat"));
|
||||
this.field_177613_u.put(Items.field_190929_cY, Lists.newArrayList("totem"));
|
||||
+ for (Entry<net.minecraftforge.registries.IRegistryDelegate<Item>, Set<String>> e : customVariantNames.entrySet())
|
||||
+ {
|
||||
+ this.field_177613_u.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator()));
|
||||
+ }
|
||||
}
|
||||
|
||||
protected List<String> func_177596_a(Item p_177596_1_)
|
||||
@@ -457,7 +473,7 @@
|
||||
|
||||
protected ResourceLocation func_177583_a(String p_177583_1_)
|
||||
{
|
||||
- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_);
|
||||
+ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", ""));
|
||||
return new ResourceLocation(resourcelocation.func_110624_b(), "item/" + resourcelocation.func_110623_a());
|
||||
}
|
||||
|
||||
@@ -565,7 +581,7 @@
|
||||
for (Entry<String, ResourceLocation> entry : this.field_177615_s.entrySet())
|
||||
{
|
||||
ResourceLocation resourcelocation = entry.getValue();
|
||||
- ModelResourceLocation modelresourcelocation = new ModelResourceLocation(entry.getKey(), "inventory");
|
||||
+ ModelResourceLocation modelresourcelocation = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey());
|
||||
ModelBlock modelblock = this.field_177611_h.get(resourcelocation);
|
||||
|
||||
if (modelblock != null && modelblock.func_178303_d())
|
||||
@@ -653,6 +669,11 @@
|
||||
@Nullable
|
||||
private IBakedModel func_177578_a(ModelBlock p_177578_1_, ModelRotation p_177578_2_, boolean p_177578_3_)
|
||||
{
|
||||
+ return bakeModel(p_177578_1_, (net.minecraftforge.common.model.ITransformation)p_177578_2_, p_177578_3_);
|
||||
+ }
|
||||
+
|
||||
+ protected IBakedModel bakeModel(ModelBlock p_177578_1_, net.minecraftforge.common.model.ITransformation p_177578_2_, boolean p_177578_3_)
|
||||
+ {
|
||||
TextureAtlasSprite textureatlassprite = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c("particle")));
|
||||
SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_, p_177578_1_.func_187967_g())).func_177646_a(textureatlassprite);
|
||||
|
||||
@@ -669,13 +690,13 @@
|
||||
BlockPartFace blockpartface = blockpart.field_178240_c.get(enumfacing);
|
||||
TextureAtlasSprite textureatlassprite1 = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d)));
|
||||
|
||||
- if (blockpartface.field_178244_b == null)
|
||||
+ if (blockpartface.field_178244_b == null || !net.minecraftforge.common.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix()))
|
||||
{
|
||||
- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
|
||||
+ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
|
||||
}
|
||||
else
|
||||
{
|
||||
- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
|
||||
+ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -686,9 +707,14 @@
|
||||
|
||||
private BakedQuad func_177589_a(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_)
|
||||
{
|
||||
- return this.field_177607_l.func_178414_a(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e);
|
||||
+ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.common.model.ITransformation)p_177589_5_, p_177589_6_);
|
||||
}
|
||||
|
||||
+ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.common.model.ITransformation p_177589_5_, boolean p_177589_6_)
|
||||
+ {
|
||||
+ return this.field_177607_l.makeBakedQuad(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e);
|
||||
+ }
|
||||
+
|
||||
private void func_177597_h()
|
||||
{
|
||||
this.func_177574_i();
|
||||
@@ -916,4 +942,23 @@
|
||||
field_177606_o.field_178317_b = "generation marker";
|
||||
field_177616_r.field_178317_b = "block entity marker";
|
||||
}
|
||||
+
|
||||
+ protected void registerMultipartVariant(ModelBlockDefinition definition, Collection<ModelResourceLocation> locations)
|
||||
+ {
|
||||
+ this.field_188642_k.put(definition, locations);
|
||||
+ }
|
||||
+
|
||||
+ private static Map<net.minecraftforge.registries.IRegistryDelegate<Item>, Set<String>> customVariantNames = Maps.newHashMap();
|
||||
+
|
||||
+ public static void registerItemVariants(Item item, ResourceLocation... names)
|
||||
+ {
|
||||
+ if (!customVariantNames.containsKey(item.delegate))
|
||||
+ {
|
||||
+ customVariantNames.put(item.delegate, Sets.<String>newHashSet());
|
||||
+ }
|
||||
+ for(ResourceLocation name : names)
|
||||
+ {
|
||||
+ customVariantNames.get(item.delegate).add(name.toString());
|
||||
+ }
|
||||
+ }
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
|
||||
@@ -49,9 +49,31 @@
|
||||
this.field_193416_e = p_i46673_2_;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException
|
||||
{
|
||||
+ Object[] data = this.loadChunk__Async(p_75815_1_, p_75815_2_, p_75815_3_);
|
||||
+
|
||||
+ if (data != null)
|
||||
+ {
|
||||
+ Chunk chunk = (Chunk) data[0];
|
||||
+ NBTTagCompound nbttagcompound = (NBTTagCompound) data[1];
|
||||
+ this.loadEntities(p_75815_1_, nbttagcompound.func_74775_l("Level"), chunk);
|
||||
+ return chunk;
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException
|
||||
+ {
|
||||
ChunkPos chunkpos = new ChunkPos(p_75815_2_, p_75815_3_);
|
||||
NBTTagCompound nbttagcompound = this.field_75828_a.get(chunkpos);
|
||||
|
||||
@@ -67,7 +89,7 @@
|
||||
nbttagcompound = this.field_193416_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream));
|
||||
}
|
||||
|
||||
- return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
|
||||
+ return this.checkedReadChunkFromNBT__Async(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
|
||||
}
|
||||
|
||||
public boolean func_191063_a(int p_191063_1_, int p_191063_2_)
|
||||
@@ -80,6 +102,13 @@
|
||||
@Nullable
|
||||
protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_)
|
||||
{
|
||||
+ Object[] data = this.checkedReadChunkFromNBT__Async(p_75822_1_, p_75822_2_, p_75822_3_, p_75822_4_);
|
||||
+ return data != null ? (Chunk)data[0] : null;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ protected Object[] checkedReadChunkFromNBT__Async(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_)
|
||||
+ {
|
||||
if (!p_75822_4_.func_150297_b("Level", 10))
|
||||
{
|
||||
field_151505_a.error("Chunk file at {},{} is missing level data, skipping", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_));
|
||||
@@ -103,10 +132,29 @@
|
||||
field_151505_a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(chunk.field_76635_g), Integer.valueOf(chunk.field_76647_h));
|
||||
nbttagcompound.func_74768_a("xPos", p_75822_2_);
|
||||
nbttagcompound.func_74768_a("zPos", p_75822_3_);
|
||||
+
|
||||
+ // Have to move tile entities since we don't load them at this stage
|
||||
+ NBTTagList _tileEntities = nbttagcompound.func_150295_c("TileEntities", 10);
|
||||
+
|
||||
+ if (_tileEntities != null)
|
||||
+ {
|
||||
+ for (int te = 0; te < _tileEntities.func_74745_c(); te++)
|
||||
+ {
|
||||
+ NBTTagCompound _nbt = (NBTTagCompound) _tileEntities.func_150305_b(te);
|
||||
+ _nbt.func_74768_a("x", p_75822_2_ * 16 + (_nbt.func_74762_e("x") - chunk.field_76635_g * 16));
|
||||
+ _nbt.func_74768_a("z", p_75822_3_ * 16 + (_nbt.func_74762_e("z") - chunk.field_76647_h * 16));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
|
||||
}
|
||||
|
||||
- return chunk;
|
||||
+ Object[] data = new Object[2];
|
||||
+ data[0] = chunk;
|
||||
+ data[1] = p_75822_4_;
|
||||
+ // event is fired in ChunkIOProvider.callStage2 since it must be fired after TE's load.
|
||||
+ // MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, par4NBTTagCompound));
|
||||
+ return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +169,10 @@
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound.func_74782_a("Level", nbttagcompound1);
|
||||
nbttagcompound.func_74768_a("DataVersion", 1343);
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(nbttagcompound);
|
||||
this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1);
|
||||
this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound);
|
||||
}
|
||||
catch (Exception exception)
|
|
@ -1,60 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
{
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
|
||||
int j = 1;
|
||||
|
||||
@@ -67,7 +68,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
|
||||
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
|
||||
{
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
|
||||
|
||||
@@ -118,7 +119,7 @@
|
||||
{
|
||||
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
|
||||
{
|
||||
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
|
||||
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
|
||||
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
|
||||
return;
|
||||
}
|
||||
@@ -166,6 +167,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
|
||||
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
|
||||
}
|
||||
}
|
||||
@@ -187,7 +189,7 @@
|
||||
|
||||
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
|
||||
{
|
||||
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
|
||||
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
|
||||
{
|
||||
return p_176374_3_;
|
||||
}
|
||||
@@ -254,11 +256,12 @@
|
||||
|
||||
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
|
||||
{
|
||||
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
|
||||
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
|
||||
+ Material mat = p_176372_3_.func_185904_a();
|
||||
|
||||
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
|
||||
{
|
||||
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
|
||||
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
|
||||
}
|
||||
else
|
||||
{
|
|
@ -1,64 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -152,12 +152,14 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
|
||||
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID);
|
||||
}
|
||||
|
||||
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_)
|
||||
{
|
||||
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
|
||||
+ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b());
|
||||
+ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID)
|
||||
{
|
||||
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
|
||||
p_189540_2_.func_175698_g(p_189540_3_);
|
||||
@@ -166,13 +168,6 @@
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
{
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
|
||||
-
|
||||
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
|
||||
- {
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- }
|
||||
-
|
||||
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
|
||||
@@ -398,6 +393,30 @@
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
+
|
||||
+ /*============================FORGE START=====================================*/
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ super.getDrops(drops, world, pos, state, fortune);
|
||||
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
|
||||
+ if (te != null && te.func_145965_a() != null)
|
||||
+ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
|
||||
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
|
||||
+ }
|
||||
+ @Override
|
||||
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool)
|
||||
+ {
|
||||
+ super.func_180657_a(world, player, pos, state, te, tool);
|
||||
+ world.func_175698_g(pos);
|
||||
+ }
|
||||
+ /*===========================FORGE END==========================================*/
|
||||
+
|
||||
public static enum EnumFlowerType implements IStringSerializable
|
||||
{
|
||||
EMPTY("empty"),
|
|
@ -1,51 +0,0 @@
|
|||
@@ -53,9 +53,9 @@
|
||||
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
|
||||
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
|
||||
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,8 @@
|
||||
this.field_150128_a = new int[32768];
|
||||
}
|
||||
|
||||
- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5)))
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks
|
||||
+ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt
|
||||
{
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -96,9 +97,9 @@
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
|
||||
Block block = iblockstate.func_177230_c();
|
||||
|
||||
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
|
||||
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
|
||||
{
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j)
|
||||
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
|
||||
{
|
||||
this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2;
|
||||
}
|
||||
|
||||
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
|
||||
@@ -274,6 +242,51 @@
|
||||
|
||||
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
|
||||
|
||||
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
|
||||
+ {
|
||||
+ if (!(Boolean)state.func_177229_b(field_176236_b))
|
||||
+ {
|
||||
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
|
||||
+ }
|
||||
+ }
|
||||
+
|
|
@ -1,49 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
@@ -284,14 +284,14 @@
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P());
|
||||
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P()));
|
||||
this.func_180688_d(p_176365_1_, p_176365_2_);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (integer.intValue() <= 4)
|
||||
{
|
||||
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P());
|
||||
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P()));
|
||||
this.func_180688_d(p_176365_1_, p_176365_2_);
|
||||
return true;
|
||||
}
|
||||
@@ -452,4 +452,29 @@
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ @SideOnly (Side.CLIENT)
|
||||
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
|
||||
+ {
|
||||
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks);
|
||||
+
|
||||
+ if (state.func_185904_a().func_76224_d())
|
||||
+ {
|
||||
+ float height = 0.0F;
|
||||
+ if (state.func_177230_c() instanceof BlockLiquid)
|
||||
+ {
|
||||
+ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F;
|
||||
+ }
|
||||
+ float f1 = (float) (pos.func_177956_o() + 1) - height;
|
||||
+ if (viewport.field_72448_b > (double)f1)
|
||||
+ {
|
||||
+ BlockPos upPos = pos.func_177984_a();
|
||||
+ IBlockState upState = world.func_180495_p(upPos);
|
||||
+ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
|
||||
+ }
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -34,9 +34,9 @@
|
||||
{
|
||||
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
|
||||
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
public static enum EnumAxis implements IStringSerializable
|
||||
{
|
||||
X("x"),
|
|
@ -1,15 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java
|
||||
@@ -145,4 +145,12 @@
|
||||
{
|
||||
return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7));
|
||||
}
|
||||
+
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ @Override
|
||||
+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
|
||||
+ {
|
||||
+ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos);
|
||||
+ }
|
||||
+ /* ========================================= FORGE END ======================================*/
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java
|
||||
@@ -80,6 +80,19 @@
|
||||
return this.func_176552_j();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
+ {
|
||||
+ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
|
||||
+ return super.doesSideBlockRendering(state, world, pos, face);
|
||||
+
|
||||
+ if ( state.func_185914_p() )
|
||||
+ return true;
|
||||
+
|
||||
+ EnumBlockHalf side = state.func_177229_b(field_176554_a);
|
||||
+ return (side == EnumBlockHalf.TOP && face == EnumFacing.UP) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.DOWN);
|
||||
+ }
|
||||
+
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
{
|
||||
IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM);
|
||||
@@ -115,7 +128,7 @@
|
||||
{
|
||||
return false;
|
||||
}
|
||||
- else
|
||||
+ else if (false) // Forge: Additional logic breaks doesSideBlockRendering and is no longer useful.
|
||||
{
|
||||
IBlockState iblockstate = p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_));
|
||||
boolean flag = func_185675_i(iblockstate) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
|
||||
@@ -149,6 +162,7 @@
|
||||
return !func_185675_i(iblockstate) || flag;
|
||||
}
|
||||
}
|
||||
+ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
|
@ -1,32 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
|
||||
@@ -483,6 +483,29 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M});
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
+ {
|
||||
+ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
|
||||
+ return super.doesSideBlockRendering(state, world, pos, face);
|
||||
+
|
||||
+ if ( state.func_185914_p() )
|
||||
+ return true;
|
||||
+
|
||||
+ state = this.func_176221_a(state, world, pos);
|
||||
+
|
||||
+ EnumHalf half = state.func_177229_b(field_176308_b);
|
||||
+ EnumFacing side = state.func_177229_b(field_176309_a);
|
||||
+ EnumShape shape = state.func_177229_b(field_176310_M);
|
||||
+ if (face == EnumFacing.UP) return half == EnumHalf.TOP;
|
||||
+ if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM;
|
||||
+ if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
|
||||
+ if (face == side) return true;
|
||||
+ if (shape == EnumShape.INNER_LEFT && face.func_176746_e() == side) return true;
|
||||
+ if (shape == EnumShape.INNER_RIGHT && face.func_176735_f() == side) return true;
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
public static enum EnumHalf implements IStringSerializable
|
||||
{
|
||||
TOP("top"),
|
|
@ -1,39 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/block/BlockStaticLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStaticLiquid.java
|
||||
@@ -52,22 +52,22 @@
|
||||
{
|
||||
blockpos = blockpos.func_177982_a(p_180650_4_.nextInt(3) - 1, 1, p_180650_4_.nextInt(3) - 1);
|
||||
|
||||
- if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256 && !p_180650_1_.func_175667_e(blockpos))
|
||||
+ if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < p_180650_1_.func_72800_K() && !p_180650_1_.func_175667_e(blockpos))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
- Block block = p_180650_1_.func_180495_p(blockpos).func_177230_c();
|
||||
+ IBlockState block = p_180650_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (block.field_149764_J == Material.field_151579_a)
|
||||
+ if (block.func_177230_c().isAir(block, p_180650_1_, blockpos))
|
||||
{
|
||||
if (this.func_176369_e(p_180650_1_, blockpos))
|
||||
{
|
||||
- p_180650_1_.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P());
|
||||
+ p_180650_1_.func_175656_a(blockpos, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos, p_180650_2_, Blocks.field_150480_ab.func_176223_P()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
- else if (block.field_149764_J.func_76230_c())
|
||||
+ else if (block.func_185904_a().func_76230_c())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
if (p_180650_1_.func_175623_d(blockpos1.func_177984_a()) && this.func_176368_m(p_180650_1_, blockpos1))
|
||||
{
|
||||
- p_180650_1_.func_175656_a(blockpos1.func_177984_a(), Blocks.field_150480_ab.func_176223_P());
|
||||
+ p_180650_1_.func_175656_a(blockpos1.func_177984_a(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos1.func_177984_a(), p_180650_2_, Blocks.field_150480_ab.func_176223_P()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
|
||||
@@ -35,6 +35,7 @@
|
||||
public final IChunkLoader field_73247_e;
|
||||
public final Long2ObjectMap<Chunk> field_73244_f = new Long2ObjectOpenHashMap<Chunk>(8192);
|
||||
public final WorldServer field_73251_h;
|
||||
+ private final Set<Long> loadingChunks = com.google.common.collect.Sets.newHashSet();
|
||||
|
||||
public ChunkProviderServer(WorldServer p_i46838_1_, IChunkLoader p_i46838_2_, IChunkGenerator p_i46838_3_)
|
||||
{
|
||||
@@ -85,20 +86,47 @@
|
||||
@Nullable
|
||||
public Chunk func_186028_c(int p_186028_1_, int p_186028_2_)
|
||||
{
|
||||
- Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_);
|
||||
+ return loadChunk(p_186028_1_, p_186028_2_, null);
|
||||
+ }
|
||||
|
||||
+ @Nullable
|
||||
+ public Chunk loadChunk(int p_186028_1_, int p_186028_2_, @Nullable Runnable runnable)
|
||||
+ {
|
||||
+ Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_);
|
||||
if (chunk == null)
|
||||
{
|
||||
- chunk = this.func_73239_e(p_186028_1_, p_186028_2_);
|
||||
-
|
||||
- if (chunk != null)
|
||||
+ long pos = ChunkPos.func_77272_a(p_186028_1_, p_186028_2_);
|
||||
+ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, this.field_73251_h);
|
||||
+ if (chunk != null || !(this.field_73247_e instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader))
|
||||
{
|
||||
+ if (!loadingChunks.add(pos)) net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk ({},{}) in dimension {} that is already being loaded. This will cause weird chunk breakages.", p_186028_1_, p_186028_2_, this.field_73251_h.field_73011_w.getDimension());
|
||||
+ if (chunk == null) chunk = this.func_73239_e(p_186028_1_, p_186028_2_);
|
||||
+
|
||||
+ if (chunk != null)
|
||||
+ {
|
||||
this.field_73244_f.put(ChunkPos.func_77272_a(p_186028_1_, p_186028_2_), chunk);
|
||||
chunk.func_76631_c();
|
||||
chunk.func_186030_a(this, this.field_186029_c);
|
||||
+ }
|
||||
+
|
||||
+ loadingChunks.remove(pos);
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ net.minecraft.world.chunk.storage.AnvilChunkLoader loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.field_73247_e;
|
||||
+ if (runnable == null || !net.minecraftforge.common.ForgeChunkManager.asyncChunkLoading)
|
||||
+ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_);
|
||||
+ else if (loader.func_191063_a(p_186028_1_, p_186028_2_))
|
||||
+ {
|
||||
+ // We can only use the async queue for already generated chunks
|
||||
+ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_, runnable);
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
+ // If we didn't load the chunk async and have a callback run it now
|
||||
+ if (runnable != null) runnable.run();
|
||||
return chunk;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/util/datafix/DataFixesManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/util/datafix/DataFixesManager.java
|
||||
@@ -165,6 +165,7 @@
|
||||
public static DataFixer func_188279_a()
|
||||
{
|
||||
DataFixer datafixer = new DataFixer(1343);
|
||||
+ datafixer = new net.minecraftforge.common.util.CompoundDataFixer(datafixer);
|
||||
WorldInfo.func_189967_a(datafixer);
|
||||
EntityPlayerMP.func_191522_a(datafixer);
|
||||
EntityPlayer.func_189806_a(datafixer);
|
|
@ -1,43 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentThorns.java
|
||||
+++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentThorns.java
|
||||
@@ -51,12 +51,12 @@
|
||||
|
||||
if (!itemstack.func_190926_b())
|
||||
{
|
||||
- itemstack.func_77972_a(3, p_151367_1_);
|
||||
+ damageArmor(itemstack, 3, p_151367_1_);
|
||||
}
|
||||
}
|
||||
else if (!itemstack.func_190926_b())
|
||||
{
|
||||
- itemstack.func_77972_a(1, p_151367_1_);
|
||||
+ damageArmor(itemstack, 1, p_151367_1_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,4 +76,25 @@
|
||||
{
|
||||
return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4);
|
||||
}
|
||||
+
|
||||
+ private void damageArmor(ItemStack stack, int amount, EntityLivingBase entity)
|
||||
+ {
|
||||
+ int slot = -1;
|
||||
+ int x = 0;
|
||||
+ for (ItemStack i : entity.func_184193_aE())
|
||||
+ {
|
||||
+ if (i == stack){
|
||||
+ slot = x;
|
||||
+ break;
|
||||
+ }
|
||||
+ x++;
|
||||
+ }
|
||||
+ if (slot == -1 || !(stack.func_77973_b() instanceof net.minecraftforge.common.ISpecialArmor))
|
||||
+ {
|
||||
+ stack.func_77972_a(1, entity);
|
||||
+ return;
|
||||
+ }
|
||||
+ net.minecraftforge.common.ISpecialArmor armor = (net.minecraftforge.common.ISpecialArmor)stack.func_77973_b();
|
||||
+ armor.damageArmor(entity, stack, DamageSource.func_92087_a(entity), amount, slot);
|
||||
+ }
|
||||
}
|
|
@ -1,183 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/entity/EntityList.java
|
||||
+++ ../src-work/minecraft/net/minecraft/entity/EntityList.java
|
||||
@@ -107,10 +107,8 @@
|
||||
public static final ResourceLocation field_191307_a = new ResourceLocation("lightning_bolt");
|
||||
private static final ResourceLocation field_191310_e = new ResourceLocation("player");
|
||||
private static final Logger field_151516_b = LogManager.getLogger();
|
||||
- public static final RegistryNamespaced < ResourceLocation, Class <? extends Entity >> field_191308_b = new RegistryNamespaced < ResourceLocation, Class <? extends Entity >> ();
|
||||
public static final Map<ResourceLocation, EntityList.EntityEggInfo> field_75627_a = Maps.<ResourceLocation, EntityList.EntityEggInfo>newLinkedHashMap();
|
||||
- public static final Set<ResourceLocation> field_191309_d = Sets.<ResourceLocation>newHashSet();
|
||||
- private static final List<String> field_191311_g = Lists.<String>newArrayList();
|
||||
+ private static final Set<ResourceLocation> EXTRA_NAMES = Sets.newHashSet();
|
||||
|
||||
@Nullable
|
||||
public static ResourceLocation func_191301_a(Entity p_191301_0_)
|
||||
@@ -121,38 +119,54 @@
|
||||
@Nullable
|
||||
public static ResourceLocation func_191306_a(Class <? extends Entity > p_191306_0_)
|
||||
{
|
||||
- return field_191308_b.func_177774_c(p_191306_0_);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191306_0_);
|
||||
+ return entry == null ? null : entry.getRegistryName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String func_75621_b(Entity p_75621_0_)
|
||||
{
|
||||
- int i = field_191308_b.func_148757_b(p_75621_0_.getClass());
|
||||
- return i == -1 ? null : (String)field_191311_g.get(i);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_75621_0_.getClass());
|
||||
+ return entry == null ? null : entry.getName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String func_191302_a(@Nullable ResourceLocation p_191302_0_)
|
||||
{
|
||||
- int i = field_191308_b.func_148757_b(field_191308_b.func_82594_a(p_191302_0_));
|
||||
- return i == -1 ? null : (String)field_191311_g.get(i);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_191302_0_);
|
||||
+ return entry == null ? null : entry.getName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static Class <? extends Entity > func_90035_a(int p_90035_0_)
|
||||
{
|
||||
- return (Class)field_191308_b.func_148754_a(p_90035_0_);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_90035_0_);
|
||||
+ return entry == null ? null : entry.getEntityClass();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static Class <? extends Entity > func_192839_a(String p_192839_0_)
|
||||
{
|
||||
- return (Class)field_191308_b.func_82594_a(new ResourceLocation(p_192839_0_));
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(new ResourceLocation(p_192839_0_));
|
||||
+ return entry == null ? null : entry.getEntityClass();
|
||||
}
|
||||
|
||||
+ public static int getID(Class<? extends Entity> cls)
|
||||
+ {
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(cls);
|
||||
+ return entry == null ? -1 : net.minecraftforge.registries.GameData.getEntityRegistry().getID(entry);
|
||||
+ }
|
||||
+
|
||||
@Nullable
|
||||
+ public static Class<? extends Entity> getClass(ResourceLocation key)
|
||||
+ {
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(key);
|
||||
+ return entry == null ? null : entry.getEntityClass();
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
public static Entity func_191304_a(@Nullable Class <? extends Entity > p_191304_0_, World p_191304_1_)
|
||||
{
|
||||
if (p_191304_0_ == null)
|
||||
@@ -163,6 +177,8 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191304_0_);
|
||||
+ if (entry != null) return entry.newInstance(p_191304_1_);
|
||||
return p_191304_0_.getConstructor(World.class).newInstance(p_191304_1_);
|
||||
}
|
||||
catch (Exception exception)
|
||||
@@ -177,13 +193,15 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static Entity func_75616_a(int p_75616_0_, World p_75616_1_)
|
||||
{
|
||||
- return func_191304_a(func_90035_a(p_75616_0_), p_75616_1_);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_75616_0_);
|
||||
+ return entry == null ? null : entry.newInstance(p_75616_1_);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Entity func_188429_b(ResourceLocation p_188429_0_, World p_188429_1_)
|
||||
{
|
||||
- return func_191304_a(field_191308_b.func_82594_a(p_188429_0_), p_188429_1_);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_188429_0_);
|
||||
+ return entry == null ? null : entry.newInstance(p_188429_1_);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -198,7 +216,16 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ try
|
||||
+ {
|
||||
entity.func_70020_e(p_75615_0_);
|
||||
+ }
|
||||
+ catch (Exception e)
|
||||
+ {
|
||||
+ net.minecraftforge.fml.common.FMLLog.log.error("An Entity {}({}) has thrown an exception during loading, its state cannot be restored. Report this to the mod author",
|
||||
+ p_75615_0_.func_74779_i("id"), entity.func_70005_c_(), e);
|
||||
+ entity = null;
|
||||
+ }
|
||||
}
|
||||
|
||||
return entity;
|
||||
@@ -206,7 +233,7 @@
|
||||
|
||||
public static Set<ResourceLocation> func_180124_b()
|
||||
{
|
||||
- return field_191309_d;
|
||||
+ return Sets.union(net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getKeys(), EXTRA_NAMES);
|
||||
}
|
||||
|
||||
public static boolean func_180123_a(Entity p_180123_0_, ResourceLocation p_180123_1_)
|
||||
@@ -373,7 +400,7 @@
|
||||
func_191305_a("zombie_horse", 3232308, 9945732);
|
||||
func_191305_a("zombie_pigman", 15373203, 5009705);
|
||||
func_191305_a("zombie_villager", 5651507, 7969893);
|
||||
- field_191309_d.add(field_191307_a);
|
||||
+ EXTRA_NAMES.add(field_191307_a);
|
||||
}
|
||||
|
||||
private static void func_191303_a(int p_191303_0_, String p_191303_1_, Class <? extends Entity > p_191303_2_, String p_191303_3_)
|
||||
@@ -394,22 +421,17 @@
|
||||
else
|
||||
{
|
||||
ResourceLocation resourcelocation = new ResourceLocation(p_191303_1_);
|
||||
- field_191308_b.func_177775_a(p_191303_0_, resourcelocation, p_191303_2_);
|
||||
- field_191309_d.add(resourcelocation);
|
||||
-
|
||||
- while (field_191311_g.size() <= p_191303_0_)
|
||||
- {
|
||||
- field_191311_g.add(null);
|
||||
- }
|
||||
-
|
||||
- field_191311_g.set(p_191303_0_, p_191303_3_);
|
||||
+ net.minecraftforge.registries.GameData.registerEntity(p_191303_0_, resourcelocation, p_191303_2_, p_191303_3_);
|
||||
}
|
||||
}
|
||||
|
||||
protected static EntityList.EntityEggInfo func_191305_a(String p_191305_0_, int p_191305_1_, int p_191305_2_)
|
||||
{
|
||||
ResourceLocation resourcelocation = new ResourceLocation(p_191305_0_);
|
||||
- return field_75627_a.put(resourcelocation, new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_));
|
||||
+ EntityList.EntityEggInfo egg = new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_);
|
||||
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(resourcelocation);
|
||||
+ if (entry != null) entry.setEgg(egg);
|
||||
+ return (EntityList.EntityEggInfo)field_75627_a.put(resourcelocation, egg);
|
||||
}
|
||||
|
||||
public static class EntityEggInfo
|
||||
@@ -428,5 +450,16 @@
|
||||
this.field_151512_d = StatList.func_151182_a(this);
|
||||
this.field_151513_e = StatList.func_151176_b(this);
|
||||
}
|
||||
+
|
||||
+ // Forge start
|
||||
+ public EntityEggInfo(ResourceLocation id, int primaryColor, int secondaryColor, StatBase killEntityStatistic, StatBase entityKilledByStatistic)
|
||||
+ {
|
||||
+ this.field_75613_a = id;
|
||||
+ this.field_75611_b = primaryColor;
|
||||
+ this.field_75612_c = secondaryColor;
|
||||
+ this.field_151512_d = killEntityStatistic;
|
||||
+ this.field_151513_e = entityKilledByStatistic;
|
||||
+ }
|
||||
+ // Forge end
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java
|
||||
@@ -105,18 +119,20 @@
|
||||
@Nullable
|
||||
public AxisAlignedBB func_70046_E()
|
||||
{
|
||||
+ if (getCollisionHandler() != null) return getCollisionHandler().getBoundingBox(this);
|
||||
return null;
|
||||
}
|
||||
@@ -1014,7 +1046,237 @@
|
||||
{
|
||||
this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean func_184230_a(EntityPlayer player, net.minecraft.util.EnumHand hand)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player, hand));
|
||||
+ }
|
|
@ -1,15 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
|
||||
@@ -158,9 +158,9 @@
|
||||
super(p_i45285_2_, p_i45285_3_);
|
||||
p_i45285_4_.field_73090_b = this;
|
||||
this.field_71134_c = p_i45285_4_;
|
||||
- BlockPos blockpos = p_i45285_2_.func_175694_M();
|
||||
+ BlockPos blockpos = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint();
|
||||
|
||||
- if (p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
|
||||
+ if (false && p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
|
||||
{
|
||||
int i = Math.max(0, p_i45285_1_.func_184108_a(p_i45285_2_));
|
||||
int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p()));
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
@@ -448,6 +449,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ private boolean isHeadspaceFree(BlockPos pos, int height)
|
||||
+ {
|
||||
+ for (int y = 0; y < height; y++)
|
||||
+ {
|
||||
+ if (!func_175162_d(pos.func_177982_a(0, y, 0))) return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
|
||||
{
|
||||
if (this.field_70145_X)
|
||||
@@ -460,30 +470,34 @@
|
||||
double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
|
||||
double d1 = p_145771_5_ - (double)blockpos.func_177952_p();
|
||||
|
||||
- if (!this.func_175162_d(blockpos))
|
||||
+ int entHeight = Math.max((int)Math.ceil(this.field_70131_O), 1);
|
||||
+
|
||||
+ boolean inTranslucentBlock = !this.isHeadspaceFree(blockpos, entHeight);
|
||||
+
|
||||
+ if (inTranslucentBlock)
|
||||
{
|
||||
int i = -1;
|
||||
double d2 = 9999.0D;
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2)
|
||||
{
|
||||
d2 = d0;
|
||||
i = 0;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2)
|
||||
{
|
||||
d2 = 1.0D - d0;
|
||||
i = 1;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2)
|
||||
{
|
||||
d2 = d1;
|
||||
i = 4;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2)
|
||||
{
|
||||
d2 = 1.0D - d1;
|
||||
i = 5;
|
||||
@@ -518,7 +532,8 @@
|
||||
|
||||
private boolean func_175162_d(BlockPos p_175162_1_)
|
||||
{
|
||||
- return !this.field_70170_p.func_180495_p(p_175162_1_).func_185915_l() && !this.field_70170_p.func_180495_p(p_175162_1_.func_177984_a()).func_185915_l();
|
||||
+ IBlockState iblockstate = field_70170_p.func_180495_p(p_175162_1_);
|
||||
+ return !iblockstate.func_177230_c().isNormalCube(iblockstate, field_70170_p, p_175162_1_);
|
||||
}
|
||||
|
||||
public void func_70031_b(boolean p_70031_1_)
|
|
@ -1,11 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java
|
||||
+++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java
|
||||
@@ -77,6 +77,8 @@
|
||||
|
||||
public void func_72786_a(Entity p_72786_1_)
|
||||
{
|
||||
+ if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return;
|
||||
+
|
||||
if (p_72786_1_ instanceof EntityPlayerMP)
|
||||
{
|
||||
this.func_72791_a(p_72786_1_, 512, 2);
|
|
@ -1,152 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java
|
||||
@@ -57,7 +57,7 @@
|
||||
this.field_111273_g = p_i1035_2_;
|
||||
this.field_78298_i = p_i1035_3_;
|
||||
this.field_78293_l = p_i1035_4_;
|
||||
- p_i1035_3_.func_110577_a(this.field_111273_g);
|
||||
+ bindTexture(this.field_111273_g);
|
||||
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g);
|
||||
+ iresource = getResource(this.field_111273_g);
|
||||
bufferedimage = TextureUtil.func_177053_a(iresource.func_110527_b());
|
||||
}
|
||||
catch (IOException ioexception)
|
||||
@@ -172,7 +172,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin"));
|
||||
+ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin"));
|
||||
iresource.func_110527_b().read(this.field_78287_e);
|
||||
}
|
||||
catch (IOException ioexception)
|
||||
@@ -187,6 +187,7 @@
|
||||
|
||||
private float func_181559_a(char p_181559_1_, boolean p_181559_2_)
|
||||
{
|
||||
+ if (p_181559_1_ == 160) return 4.0F; // forge: display nbsp as space. MC-2595
|
||||
if (p_181559_1_ == ' ')
|
||||
{
|
||||
return 4.0F;
|
||||
@@ -203,7 +204,7 @@
|
||||
int i = p_78266_1_ % 16 * 8;
|
||||
int j = p_78266_1_ / 16 * 8;
|
||||
int k = p_78266_2_ ? 1 : 0;
|
||||
- this.field_78298_i.func_110577_a(this.field_111273_g);
|
||||
+ bindTexture(this.field_111273_g);
|
||||
int l = this.field_78286_d[p_78266_1_];
|
||||
float f = (float)l - 0.01F;
|
||||
GlStateManager.func_187447_r(5);
|
||||
@@ -231,7 +232,7 @@
|
||||
|
||||
private void func_78257_a(int p_78257_1_)
|
||||
{
|
||||
- this.field_78298_i.func_110577_a(this.func_111271_a(p_78257_1_));
|
||||
+ bindTexture(this.func_111271_a(p_78257_1_));
|
||||
}
|
||||
|
||||
protected float func_78277_a(char p_78277_1_, boolean p_78277_2_)
|
||||
@@ -280,7 +281,7 @@
|
||||
|
||||
public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_)
|
||||
{
|
||||
- GlStateManager.func_179141_d();
|
||||
+ enableAlpha();
|
||||
this.func_78265_b();
|
||||
int i;
|
||||
|
||||
@@ -350,7 +351,7 @@
|
||||
|
||||
int j1 = this.field_78285_g[i1];
|
||||
this.field_78304_r = j1;
|
||||
- GlStateManager.func_179131_c((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q);
|
||||
+ setColor((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q);
|
||||
}
|
||||
else if (i1 == 16)
|
||||
{
|
||||
@@ -379,7 +380,7 @@
|
||||
this.field_78299_w = false;
|
||||
this.field_78300_v = false;
|
||||
this.field_78301_u = false;
|
||||
- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
|
||||
+ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
|
||||
}
|
||||
|
||||
++i;
|
||||
@@ -407,7 +408,7 @@
|
||||
c0 = c1;
|
||||
}
|
||||
|
||||
- float f1 = this.field_78293_l ? 0.5F : 1.0F;
|
||||
+ float f1 = j == -1 || this.field_78293_l ? 0.5f : 1f;
|
||||
boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_;
|
||||
|
||||
if (flag)
|
||||
@@ -445,7 +446,16 @@
|
||||
|
||||
++f;
|
||||
}
|
||||
+ doDraw(f);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ protected void doDraw(float f)
|
||||
+ {
|
||||
+ {
|
||||
+ {
|
||||
+
|
||||
if (this.field_78299_w)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.func_178181_a();
|
||||
@@ -518,7 +528,7 @@
|
||||
this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F;
|
||||
this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F;
|
||||
this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F;
|
||||
- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
|
||||
+ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
|
||||
this.field_78295_j = p_180455_2_;
|
||||
this.field_78296_k = p_180455_3_;
|
||||
this.func_78255_a(p_180455_1_, p_180455_5_);
|
||||
@@ -576,6 +586,7 @@
|
||||
|
||||
public int func_78263_a(char p_78263_1_)
|
||||
{
|
||||
+ if (p_78263_1_ == 160) return 4; // forge: display nbsp as space. MC-2595
|
||||
if (p_78263_1_ == 167)
|
||||
{
|
||||
return -1;
|
||||
@@ -849,6 +860,26 @@
|
||||
return this.field_78294_m;
|
||||
}
|
||||
|
||||
+ protected void setColor(float r, float g, float b, float a)
|
||||
+ {
|
||||
+ GlStateManager.func_179131_c(r,g,b,a);
|
||||
+ }
|
||||
+
|
||||
+ protected void enableAlpha()
|
||||
+ {
|
||||
+ GlStateManager.func_179141_d();
|
||||
+ }
|
||||
+
|
||||
+ protected void bindTexture(ResourceLocation location)
|
||||
+ {
|
||||
+ field_78298_i.func_110577_a(location);
|
||||
+ }
|
||||
+
|
||||
+ protected IResource getResource(ResourceLocation location) throws IOException
|
||||
+ {
|
||||
+ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location);
|
||||
+ }
|
||||
+
|
||||
public int func_175064_b(char p_175064_1_)
|
||||
{
|
||||
int i = "0123456789abcdef".indexOf(p_175064_1_);
|
|
@ -1,32 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
||||
@@ -30,7 +30,8 @@
|
||||
|
||||
this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + -16, I18n.func_135052_a("menu.returnToGame")));
|
||||
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.options")));
|
||||
- GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.shareToLan")));
|
||||
+ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("fml.menu.modoptions")));
|
||||
+ GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + -16, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0])));
|
||||
guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c();
|
||||
this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.advancements")));
|
||||
this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.stats")));
|
||||
@@ -73,13 +74,19 @@
|
||||
this.field_146297_k.func_71381_h();
|
||||
break;
|
||||
case 5:
|
||||
+ if (this.field_146297_k.field_71439_g != null)
|
||||
this.field_146297_k.func_147108_a(new GuiScreenAdvancements(this.field_146297_k.field_71439_g.field_71174_a.func_191982_f()));
|
||||
break;
|
||||
case 6:
|
||||
+ if (this.field_146297_k.field_71439_g != null)
|
||||
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
|
||||
break;
|
||||
case 7:
|
||||
this.field_146297_k.func_147108_a(new GuiShareToLan(this));
|
||||
+ break;
|
||||
+ case 12:
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().showInGameModOptions(this);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
|
||||
@@ -41,6 +41,7 @@
|
||||
public GuiMultiplayer(GuiScreen p_i1040_1_)
|
||||
{
|
||||
this.field_146798_g = p_i1040_1_;
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setupServerList();
|
||||
}
|
||||
|
||||
public void func_73866_w_()
|
||||
@@ -375,7 +376,7 @@
|
||||
|
||||
private void func_146791_a(ServerData p_146791_1_)
|
||||
{
|
||||
- this.field_146297_k.func_147108_a(new GuiConnecting(this, this.field_146297_k, p_146791_1_));
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, p_146791_1_);
|
||||
}
|
||||
|
||||
public void func_146790_a(int p_146790_1_)
|
|
@ -1,12 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
||||
@@ -189,6 +189,9 @@
|
||||
long l = j - k;
|
||||
List<String> list = Lists.newArrayList(String.format("Java: %s %dbit", System.getProperty("java.version"), this.field_175242_a.func_147111_S() ? 64 : 32), String.format("Mem: % 2d%% %03d/%03dMB", l * 100L / i, func_175240_a(l), func_175240_a(i)), String.format("Allocated: % 2d%% %03dMB", j * 100L / i, func_175240_a(j)), "", String.format("CPU: %s", OpenGlHelper.func_183029_j()), "", String.format("Display: %dx%d (%s)", Display.getWidth(), Display.getHeight(), GlStateManager.func_187416_u(7936)), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938));
|
||||
|
||||
+ list.add("");
|
||||
+ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
|
||||
+
|
||||
if (this.field_175242_a.func_189648_am())
|
||||
{
|
||||
return list;
|
|
@ -1,40 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
@@ -421,9 +434,15 @@
|
||||
|
||||
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
|
||||
{
|
||||
+ net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
|
||||
+ break;
|
||||
+ guibutton = event.getButton();
|
||||
this.field_146290_a = guibutton;
|
||||
guibutton.func_146113_a(this.field_146297_k.func_147118_V());
|
||||
this.func_146284_a(guibutton);
|
||||
+ if (this.equals(this.field_146297_k.field_71462_r))
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.field_146292_n));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,7 +496,10 @@
|
||||
{
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ this.mouseHandled = false;
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue;
|
||||
this.func_146274_d();
|
||||
+ if (this.equals(this.field_146297_k.field_71462_r) && !this.mouseHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +507,10 @@
|
||||
{
|
||||
while (Keyboard.next())
|
||||
{
|
||||
+ this.keyHandled = false;
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue;
|
||||
this.func_146282_l();
|
||||
+ if (this.equals(this.field_146297_k.field_71462_r) && !this.keyHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/item/ItemBlock.java
|
||||
+++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java
|
||||
@@ -49,24 +49,12 @@
|
||||
if (!itemstack.func_190926_b() && p_180614_1_.func_175151_a(p_180614_3_, p_180614_5_, itemstack) && p_180614_2_.func_190527_a(this.field_150939_a, p_180614_3_, false, p_180614_5_, (Entity)null))
|
||||
{
|
||||
int i = this.func_77647_b(itemstack.func_77960_j());
|
||||
- IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_);
|
||||
+ IBlockState iblockstate1 = this.field_150939_a.getStateForPlacement(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_, p_180614_4_);
|
||||
|
||||
- if (p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 11))
|
||||
+ if (placeBlockAt(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, iblockstate1))
|
||||
{
|
||||
iblockstate1 = p_180614_2_.func_180495_p(p_180614_3_);
|
||||
-
|
||||
- if (iblockstate1.func_177230_c() == this.field_150939_a)
|
||||
- {
|
||||
- func_179224_a(p_180614_2_, p_180614_1_, p_180614_3_, itemstack);
|
||||
- this.field_150939_a.func_180633_a(p_180614_2_, p_180614_3_, iblockstate1, p_180614_1_, itemstack);
|
||||
-
|
||||
- if (p_180614_1_ instanceof EntityPlayerMP)
|
||||
- {
|
||||
- CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)p_180614_1_, p_180614_3_, itemstack);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- SoundType soundtype = this.field_150939_a.func_185467_w();
|
||||
+ SoundType soundtype = iblockstate1.func_177230_c().getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_);
|
||||
p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F);
|
||||
itemstack.func_190918_g(1);
|
||||
}
|
||||
@@ -127,7 +115,7 @@
|
||||
{
|
||||
Block block = p_179222_1_.func_180495_p(p_179222_2_).func_177230_c();
|
||||
|
||||
- if (block == Blocks.field_150431_aC)
|
||||
+ if (block == Blocks.field_150431_aC && block.func_176200_f(p_179222_1_, p_179222_2_))
|
||||
{
|
||||
p_179222_3_ = EnumFacing.UP;
|
||||
}
|
||||
@@ -171,6 +159,36 @@
|
||||
+ /**
|
||||
+ * Called to actually place the block, after the location is determined
|
||||
+ * and all permission checks have been made.
|
||||
+ *
|
||||
+ * @param stack The item stack that was used to place the block. This can be changed inside the method.
|
||||
+ * @param player The player who is placing the block. Can be null if the block is not being placed by a player.
|
||||
+ * @param side The side the player (or machine) right-clicked on.
|
||||
+ */
|
||||
+ public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
|
||||
+ {
|
||||
+ if (!world.func_180501_a(pos, newState, 11)) return false;
|
||||
+
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() == this.field_150939_a)
|
||||
+ {
|
||||
+ func_179224_a(world, player, pos, stack);
|
||||
+ this.field_150939_a.func_180633_a(world, pos, state, player, stack);
|
||||
+
|
||||
+ if (player instanceof EntityPlayerMP)
|
||||
+ CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)player, pos, stack);
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/item/ItemSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java
|
||||
@@ -43,13 +43,18 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ if (p_180614_2_.func_180495_p(p_180614_3_).func_177230_c().func_176200_f(p_180614_2_, p_180614_3_))
|
||||
+ {
|
||||
+ p_180614_5_ = EnumFacing.UP;
|
||||
+ p_180614_3_ = p_180614_3_.func_177977_b();
|
||||
+ }
|
||||
IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_);
|
||||
Block block = iblockstate.func_177230_c();
|
||||
boolean flag = block.func_176200_f(p_180614_2_, p_180614_3_);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
- if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a())
|
||||
+ if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a() && !p_180614_2_.isSideSolid(p_180614_3_, p_180614_5_, true))
|
||||
{
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java
|
||||
@@ -139,6 +139,10 @@
|
||||
GlStateManager.func_179086_m(16640);
|
||||
}
|
||||
|
||||
+ try
|
||||
+ {
|
||||
+ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering
|
||||
+ {
|
||||
Tessellator tessellator = Tessellator.func_178181_a();
|
||||
BufferBuilder bufferbuilder = tessellator.func_178180_c();
|
||||
this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
@@ -174,6 +178,12 @@
|
||||
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215);
|
||||
this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215);
|
||||
+ }
|
||||
+ }
|
||||
+ catch (java.io.IOException e)
|
||||
+ {
|
||||
+ throw new RuntimeException(e);
|
||||
+ } //FML End
|
||||
this.field_146588_g.func_147609_e();
|
||||
|
||||
if (OpenGlHelper.func_148822_b())
|
|
@ -1,103 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -536,23 +544,27 @@
|
||||
- this.field_71446_o.func_147645_c(this.field_152354_ay);
|
||||
+ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay);
|
||||
this.field_152354_ay = null;
|
||||
this.field_71461_s = new LoadingScreenRenderer(this);
|
||||
this.field_184132_p = new DebugRenderer(this);
|
||||
@@ -1630,6 +1653,11 @@
|
||||
}
|
||||
|
||||
Display.setFullscreen(this.field_71431_Q);
|
||||
+ if (!this.field_71431_Q) //Forge: Fix MC-68754, Screen is not resizeable after exiting fullscreen due to LWJGL bug https://github.com/LWJGL/lwjgl/issues/142 which is fixed, but not in the version MC ships
|
||||
+ {
|
||||
+ Display.setResizable(false);
|
||||
+ Display.setResizable(true);
|
||||
+ }
|
||||
Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
|
||||
this.func_175601_h();
|
||||
}
|
||||
@@ -2239,6 +2271,8 @@
|
||||
{
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
|
||||
+
|
||||
int i = Mouse.getEventButton();
|
||||
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
|
||||
|
||||
@@ -2304,6 +2339,7 @@
|
||||
|
||||
public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_)
|
||||
{
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_);
|
||||
this.func_71403_a((WorldClient)null);
|
||||
System.gc();
|
||||
ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
|
||||
@@ -2344,8 +2380,14 @@
|
||||
|
||||
this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel"));
|
||||
|
||||
- while (!this.field_71437_Z.func_71200_ad())
|
||||
+ while (!this.field_71437_Z.func_71200_ad() && !this.field_71437_Z.func_71241_aa())
|
||||
{
|
||||
+ if (!net.minecraftforge.fml.common.StartupQuery.check())
|
||||
+ {
|
||||
+ func_71403_a(null);
|
||||
+ func_147108_a(null);
|
||||
+ return;
|
||||
+ }
|
||||
String s = this.field_71437_Z.func_71195_b_();
|
||||
|
||||
if (s != null)
|
||||
@@ -2395,6 +2445,18 @@
|
||||
if (this.field_71437_Z != null && this.field_71437_Z.func_175578_N())
|
||||
{
|
||||
this.field_71437_Z.func_71263_m();
|
||||
+ if (field_71461_s != null && this.field_71425_J)
|
||||
+ {
|
||||
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
|
||||
+ }
|
||||
+ while (!field_71437_Z.func_71241_aa())
|
||||
+ {
|
||||
+ try
|
||||
+ {
|
||||
+ Thread.sleep(10);
|
||||
+ }
|
||||
+ catch (InterruptedException ie) {}
|
||||
+ }
|
||||
}
|
||||
|
||||
this.field_71437_Z = null;
|
||||
@@ -2418,6 +2480,7 @@
|
||||
this.field_71456_v.func_181029_i();
|
||||
this.func_71351_a((ServerData)null);
|
||||
this.field_71455_al = false;
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.field_71441_e);
|
||||
}
|
||||
|
||||
this.field_147127_av.func_147690_c();
|
||||
@@ -3181,11 +3089,11 @@
|
||||
{
|
||||
if (Keyboard.getEventKeyState())
|
||||
{
|
||||
- if (i == this.field_71474_y.field_152395_am.func_151463_i())
|
||||
+ if (this.field_71474_y.field_152395_am.isActiveAndMatches(i))
|
||||
{
|
||||
this.func_71352_k();
|
||||
}
|
||||
- else if (i == this.field_71474_y.field_151447_Z.func_151463_i())
|
||||
+ else if (this.field_71474_y.field_151447_Z.isActiveAndMatches(i))
|
||||
{
|
||||
this.field_71456_v.func_146158_b().func_146227_a(ScreenShotHelper.func_148260_a(this.field_71412_D, this.field_71443_c, this.field_71440_d, this.field_147124_at));
|
||||
}
|
||||
@@ -3199,6 +3107,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+ else if (this.field_71462_r instanceof GuiControls) ((GuiControls)this.field_71462_r).field_146491_f = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java
|
||||
@@ -69,7 +69,7 @@
|
||||
if (entityplayermp == null)
|
||||
{
|
||||
this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT;
|
||||
- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_181025_l);
|
||||
+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_181025_l);
|
||||
this.field_181025_l = null;
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i));
|
||||
+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/network/NetworkManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java
|
||||
@@ -204,7 +209,7 @@
|
||||
final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_);
|
||||
final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get();
|
||||
|
||||
- if (enumconnectionstate1 != enumconnectionstate)
|
||||
+ if (enumconnectionstate1 != enumconnectionstate && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
|
||||
{
|
||||
field_150735_g.debug("Disabled auto read");
|
||||
this.field_150746_k.config().setAutoRead(false);
|
||||
@@ -212,7 +217,7 @@
|
||||
|
||||
if (this.field_150746_k.eventLoop().inEventLoop())
|
||||
{
|
||||
- if (enumconnectionstate != enumconnectionstate1)
|
||||
+ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
|
||||
{
|
||||
this.func_150723_a(enumconnectionstate);
|
||||
}
|
||||
@@ -232,7 +237,7 @@
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
- if (enumconnectionstate != enumconnectionstate1)
|
||||
+ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
|
||||
{
|
||||
NetworkManager.this.func_150723_a(enumconnectionstate);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/server/management/PlayerList.java
|
||||
+++ ../src-work/minecraft/net/minecraft/server/management/PlayerList.java
|
||||
@@ -106,7 +106,7 @@
|
||||
this.field_72405_c = 8;
|
||||
}
|
||||
|
||||
- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_)
|
||||
+ public void initializeConnectionToPlayer(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_, NetHandlerPlayServer nethandlerplayserver)
|
||||
{
|
||||
GameProfile gameprofile = p_72355_2_.func_146103_bH();
|
||||
PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax();
|
||||
@@ -127,8 +138,9 @@
|
||||
WorldServer worldserver = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
|
||||
WorldInfo worldinfo = worldserver.func_72912_H();
|
||||
this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver);
|
||||
- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_);
|
||||
+ p_72355_2_.field_71135_a = nethandlerplayserver;
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireServerConnectionEvent(p_72355_1_);
|
||||
nethandlerplayserver.func_147359_a(new SPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName())));
|
||||
nethandlerplayserver.func_147359_a(new SPacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
|
||||
nethandlerplayserver.func_147359_a(new SPacketPlayerAbilities(p_72355_2_.field_71075_bZ));
|
|
@ -1,21 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java
|
||||
@@ -127,8 +127,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this);
|
||||
file1 = new File(this.field_75770_b, "level.dat_old");
|
||||
return file1.exists() ? SaveFormatOld.func_186353_a(file1, this.field_186341_a) : null;
|
||||
}
|
||||
|
||||
public void func_75755_a(WorldInfo p_75755_1_, @Nullable NBTTagCompound p_75755_2_)
|
||||
@@ -137,6 +138,8 @@
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.func_74782_a("Data", nbttagcompound);
|
||||
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound1);
|
||||
+
|
||||
try
|
||||
{
|
||||
File file1 = new File(this.field_75770_b, "level.dat_new");
|
|
@ -1,23 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
||||
@@ -83,7 +83,7 @@
|
||||
boolean flag1 = this.field_148301_e.field_82821_f < 340;
|
||||
boolean flag2 = flag || flag1;
|
||||
this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_192634_2_ + 32 + 3, p_192634_3_ + 1, 16777215);
|
||||
- List<String> list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_192634_4_ - 32 - 2);
|
||||
+ List<String> list = this.field_148300_d.field_71466_p.func_78271_c(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.field_78843_d), p_192634_4_ - 32 - 2);
|
||||
|
||||
for (int i = 0; i < Math.min(list.size(), 2); ++i)
|
||||
{
|
||||
@@ -177,6 +177,11 @@
|
||||
int i1 = p_192634_6_ - p_192634_2_;
|
||||
int j1 = p_192634_7_ - p_192634_3_;
|
||||
|
||||
+ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_192634_2_, p_192634_4_, p_192634_3_, i1, j1);
|
||||
+ if (tooltip != null)
|
||||
+ {
|
||||
+ this.field_148303_c.func_146793_a(tooltip);
|
||||
+ } else
|
||||
if (i1 >= p_192634_4_ - 15 && i1 <= p_192634_4_ - 5 && j1 >= 0 && j1 <= 8)
|
||||
{
|
||||
this.field_148303_c.func_146793_a(s1);
|
|
@ -1,150 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/World.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/World.java
|
||||
@@ -527,11 +579,11 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_190529_1_);
|
||||
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_190976_dk)
|
||||
+ if (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
- ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
|
||||
+ iblockstate.func_177230_c().observedNeighborChange(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -543,7 +595,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
- return String.format("ID #%d (%s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getCanonicalName());
|
||||
+ return String.format("ID #%d (%s // %s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getName(), p_190529_2_.getRegistryName());
|
||||
}
|
||||
catch (Throwable var2)
|
||||
{
|
||||
@@ -1227,6 +1291,7 @@
|
||||
IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
|
||||
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
|
||||
|
||||
+ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_)) return true;
|
||||
try
|
||||
{
|
||||
for (int k1 = i; k1 < j; ++k1)
|
||||
@@ -1269,7 +1334,7 @@
|
||||
|
||||
iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
|
||||
|
||||
- if (p_191504_3_ && !p_191504_4_.isEmpty())
|
||||
+ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_))
|
||||
{
|
||||
boolean flag5 = true;
|
||||
return flag5;
|
||||
@@ -1319,11 +1384,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.GetCollisionBoxesEvent(this, p_184144_1_, p_184144_2_, list));
|
||||
return list;
|
||||
}
|
||||
@@ -1522,9 +1620,9 @@
|
||||
for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1)
|
||||
{
|
||||
blockpos1 = blockpos.func_177977_b();
|
||||
- Material material = chunk.func_177435_g(blockpos1).func_185904_a();
|
||||
+ IBlockState state = chunk.func_177435_g(blockpos1);
|
||||
|
||||
- if (material.func_76230_c() && material != Material.field_151584_j)
|
||||
+ if (state.func_185904_a().func_76230_c() && !state.func_177230_c().isLeaves(state, this, blockpos1) && !state.func_177230_c().isFoliage(this, blockpos1))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1972,6 +2128,12 @@
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
|
||||
|
||||
+ Boolean result = iblockstate1.func_177230_c().isAABBInsideLiquid(this, blockpos$pooledmutableblockpos, p_72953_1_);
|
||||
+ if (result != null) {
|
||||
+ if (!result) continue;
|
||||
+ blockpos$pooledmutableblockpos.func_185344_t();
|
||||
+ return true;
|
||||
+ }
|
||||
if (iblockstate1.func_185904_a().func_76224_d())
|
||||
{
|
||||
blockpos$pooledmutableblockpos.func_185344_t();
|
||||
@@ -2050,6 +2217,16 @@
|
||||
IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
|
||||
Block block = iblockstate1.func_177230_c();
|
||||
|
||||
+ Boolean result = block.isEntityInsideMaterial(this, blockpos$pooledmutableblockpos, iblockstate1, p_72918_3_, (double)i3, p_72918_2_, false);
|
||||
+ if (result != null && result == true)
|
||||
+ {
|
||||
+ // Forge: When requested call blocks modifyAcceleration method, and more importantly cause this method to return true, which results in an entity being "inWater"
|
||||
+ flag = true;
|
||||
+ vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
|
||||
+ continue;
|
||||
+ }
|
||||
+ else if (result != null && result == false) continue;
|
||||
+
|
||||
if (iblockstate1.func_185904_a() == p_72918_2_)
|
||||
{
|
||||
double d0 = (double)((float)(i4 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate1.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
|
||||
@@ -2095,7 +2272,14 @@
|
||||
{
|
||||
for (int j4 = j3; j4 < k3; ++j4)
|
||||
{
|
||||
- if (this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)).func_185904_a() == p_72875_2_)
|
||||
+ IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
|
||||
+ Boolean result = iblockstate1.func_177230_c().isAABBInsideMaterial(this, blockpos$pooledmutableblockpos, p_72875_1_, p_72875_2_);
|
||||
+ if (result != null) {
|
||||
+ if (!result) continue;
|
||||
+ blockpos$pooledmutableblockpos.func_185344_t();
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (iblockstate1.func_185904_a() == p_72875_2_)
|
||||
{
|
||||
blockpos$pooledmutableblockpos.func_185344_t();
|
||||
return true;
|
||||
@@ -2484,6 +2687,11 @@
|
||||
|
||||
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
|
||||
{
|
||||
+ return this.field_73011_w.canBlockFreeze(p_175670_1_, p_175670_2_);
|
||||
+ }
|
||||
+
|
||||
+ public boolean canBlockFreezeBody(BlockPos p_175670_1_, boolean p_175670_2_)
|
||||
+ {
|
||||
Biome biome = this.func_180494_b(p_175670_1_);
|
||||
float f = biome.func_180626_a(p_175670_1_);
|
||||
|
||||
@@ -2525,6 +2733,11 @@
|
||||
|
||||
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
|
||||
{
|
||||
+ return this.field_73011_w.canSnowAt(p_175708_1_, p_175708_2_);
|
||||
+ }
|
||||
+
|
||||
+ public boolean canSnowAtBody(BlockPos p_175708_1_, boolean p_175708_2_)
|
||||
+ {
|
||||
Biome biome = this.func_180494_b(p_175708_1_);
|
||||
float f = biome.func_180626_a(p_175708_1_);
|
||||
|
||||
@@ -2542,7 +2755,7 @@
|
||||
{
|
||||
IBlockState iblockstate1 = this.func_180495_p(p_175708_1_);
|
||||
|
||||
- if (iblockstate1.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_))
|
||||
+ if (iblockstate1.func_177230_c().isAir(iblockstate1, this, p_175708_1_) && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -2958,7 +3175,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return iblockstate1.func_185904_a().func_76222_j() && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_);
|
||||
+ return iblockstate1.func_177230_c().func_176200_f(this, p_190527_2_) && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java
|
||||
@@ -161,7 +161,8 @@
|
||||
|
||||
if (p_180709_1_.func_175675_v(p_180709_3_.func_177982_a(k2, 4, l3)))
|
||||
{
|
||||
- p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), 2);
|
||||
+ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks.
|
||||
+ p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), flag); //Forge
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java
|
||||
@@ -33,7 +33,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, 2);
|
||||
+ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks.
|
||||
+ p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, flag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java
|
||||
@@ -63,8 +63,9 @@
|
||||
private double field_176153_H = 0.2D;
|
||||
private int field_176154_I = 5;
|
||||
private int field_176155_J = 15;
|
||||
private GameRules field_82577_x = new GameRules();
|
||||
+ private java.util.Map<String, net.minecraft.nbt.NBTBase> additionalProperties;
|
||||
|
||||
protected WorldInfo()
|
||||
{
|
||||
@@ -366,6 +367,7 @@
|
||||
p_76064_1_.func_74780_a("BorderSizeLerpTarget", this.field_176148_F);
|
||||
p_76064_1_.func_74780_a("BorderWarningBlocks", (double)this.field_176154_I);
|
||||
p_76064_1_.func_74780_a("BorderWarningTime", (double)this.field_176155_J);
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(p_76064_1_);
|
||||
|
||||
if (this.field_176158_z != null)
|
||||
{
|
||||
@@ -708,6 +711,7 @@
|
||||
|
||||
public void func_176144_a(EnumDifficulty p_176144_1_)
|
||||
{
|
||||
+ net.minecraftforge.common.ForgeHooks.onDifficultyChange(p_176144_1_, this.field_176158_z);
|
||||
this.field_176158_z = p_176144_1_;
|
||||
}
|
||||
|
||||
@@ -805,18 +809,49 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
+ /**
|
||||
+ * Allow access to additional mod specific world based properties
|
||||
+ * Used by FML to store mod list associated with a world, and maybe an id map
|
||||
+ * Used by Forge to store the dimensions available to a world
|
||||
+ * @param additionalProperties
|
||||
+ */
|
||||
+ public void setAdditionalProperties(java.util.Map<String,net.minecraft.nbt.NBTBase> additionalProperties)
|
||||
+ {
|
||||
+ // one time set for this
|
||||
+ if (this.additionalProperties == null)
|
||||
+ {
|
||||
+ this.additionalProperties = additionalProperties;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ public net.minecraft.nbt.NBTBase getAdditionalProperty(String additionalProperty)
|
||||
+ {
|
||||
+ return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null;
|
||||
+ }
|
||||
+
|
|
@ -1,22 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/WorldServer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/WorldServer.java
|
||||
@@ -525,7 +539,10 @@
|
||||
{
|
||||
if (p_175654_2_.func_149698_L())
|
||||
{
|
||||
- if (this.func_175707_a(p_175654_1_.func_177982_a(-8, -8, -8), p_175654_1_.func_177982_a(8, 8, 8)))
|
||||
+ //Keeping here as a note for future when it may be restored.
|
||||
+ boolean isForced = getPersistentChunks().containsKey(new ChunkPos(p_175654_1_));
|
||||
+ int range = isForced ? 0 : 8;
|
||||
+ if (this.func_175707_a(p_175654_1_.func_177982_a(-range, -range, -range), p_175654_1_.func_177982_a(range, range, range)))
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175654_1_);
|
||||
|
||||
@@ -561,6 +578,7 @@
|
||||
|
||||
public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_)
|
||||
{
|
||||
+ if (p_180497_2_ == null) return; //Forge: Prevent null blocks from ticking, can happen if blocks are removed in old worlds. TODO: Fix real issue causing block to be null.
|
||||
NextTickListEntry nextticklistentry = new NextTickListEntry(p_180497_1_, p_180497_2_);
|
||||
nextticklistentry.func_82753_a(p_180497_4_);
|
||||
Material material = p_180497_2_.func_176223_P().func_185904_a();
|
|
@ -1,47 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/world/WorldType.java
|
||||
+++ ../src-work/minecraft/net/minecraft/world/WorldType.java
|
||||
@@ -113,4 +114,145 @@
|
||||
this.field_151361_l = true;
|
||||
return this;
|
||||
}
|
||||
+
|
||||
+ public int getMinimumSpawnHeight(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? 4 : world.func_181545_F() + 1;
|
||||
+ }
|
||||
+
|
||||
+ public double voidFadeMagnitude()
|
||||
+ {
|
||||
+ return this == field_77138_c ? 1.0D : 0.03125D;
|
||||
+ }
|
||||
+
|
||||
+ /*=================================================== FORGE START ======================================*/
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the spawn fuzz for players who join the world.
|
||||
+ * Useful for void world types.
|
||||
+ * @return Fuzz for entity initial spawn in blocks.
|
||||
+ */
|
||||
+ public int getSpawnFuzz(WorldServer world, net.minecraft.server.MinecraftServer server)
|
||||
+ {
|
||||
+ return Math.max(0, server.func_184108_a(world));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates the GenLayerBiome used for generating the world with the specified ChunkProviderSettings JSON String
|
||||
+ * *IF AND ONLY IF* this WorldType == WorldType.CUSTOMIZED.
|
||||
+ *
|
||||
+ *
|
||||
+ * @param worldSeed The world seed
|
||||
+ * @param parentLayer The parent layer to feed into any layer you return
|
||||
+ * @param chunkSettings The ChunkGeneratorSettings constructed from the custom JSON
|
||||
+ * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome
|
||||
+ */
|
||||
+ public net.minecraft.world.gen.layer.GenLayer getBiomeLayer(long worldSeed, net.minecraft.world.gen.layer.GenLayer parentLayer, net.minecraft.world.gen.ChunkGeneratorSettings chunkSettings)
|
||||
+ {
|
||||
+ net.minecraft.world.gen.layer.GenLayer ret = new net.minecraft.world.gen.layer.GenLayerBiome(200L, parentLayer, this, chunkSettings);
|
||||
+ ret = net.minecraft.world.gen.layer.GenLayerZoom.func_75915_a(1000L, ret, 2);
|
||||
+ ret = new net.minecraft.world.gen.layer.GenLayerBiomeEdge(1000L, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model.data;
|
||||
|
||||
public enum EmptyModelData implements IModelData
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model.data;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model.data;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model.data;
|
||||
|
||||
import java.util.IdentityHashMap;
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.model.data;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -22,8 +22,8 @@ package net.minecraftforge.test;
|
|||
import com.google.common.collect.Lists;
|
||||
import net.minecraftforge.common.util.TextTable;
|
||||
import net.minecraftforge.common.util.TextTable.Column;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import static net.minecraftforge.common.util.TextTable.column;
|
||||
|
||||
|
@ -38,12 +38,12 @@ public class TextTableTest
|
|||
Column column = column("Column", TextTable.Alignment.LEFT);
|
||||
column.fit(WIDTH_REFERENCE);
|
||||
String paddedHeader = column.formatHeader("-");
|
||||
Assert.assertEquals("Formatted column header didn't have correct length", WIDTH_REFERENCE_LENGTH, paddedHeader.length());
|
||||
Assert.assertEquals("Formatted column header wasn't padded properly", "Column---------", paddedHeader);
|
||||
assertEquals(WIDTH_REFERENCE_LENGTH, paddedHeader.length(), "Formatted column header didn't have correct length");
|
||||
assertEquals("Column---------", paddedHeader, "Formatted column header wasn't padded properly");
|
||||
|
||||
String paddedReference = column.format(WIDTH_REFERENCE, "-");
|
||||
Assert.assertEquals("Formatted width reference didn't have correct length", WIDTH_REFERENCE_LENGTH, paddedReference.length());
|
||||
Assert.assertEquals("Formatted width reference was changed despite defining width", WIDTH_REFERENCE, paddedReference);
|
||||
assertEquals(WIDTH_REFERENCE_LENGTH, paddedReference.length(), "Formatted width reference didn't have correct length");
|
||||
assertEquals(WIDTH_REFERENCE, paddedReference, "Formatted width reference was changed despite defining width");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -52,12 +52,9 @@ public class TextTableTest
|
|||
Column column = column("Left", TextTable.Alignment.LEFT);
|
||||
column.fit(WIDTH_REFERENCE);
|
||||
|
||||
String paddedHeader = column.formatHeader("-");
|
||||
Assert.assertEquals("Left-aligned header should be padded on the right", "Left-----------", paddedHeader);
|
||||
String paddedReference = column.format(WIDTH_REFERENCE, "-");
|
||||
Assert.assertEquals("Left-aligned reference should'nt be padded", WIDTH_REFERENCE, paddedReference);
|
||||
String paddedValue = column.format("Value", "-");
|
||||
Assert.assertEquals("Left-aligned value should be padded on the right", "Value----------", paddedValue);
|
||||
assertEquals("Left-----------", column.formatHeader("-"), "Left-aligned header should be padded on the right");
|
||||
assertEquals(WIDTH_REFERENCE, column.format(WIDTH_REFERENCE, "-"), "Left-aligned reference should'nt be padded");
|
||||
assertEquals("Value----------", column.format("Value", "-"), "Left-aligned value should be padded on the right");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -66,14 +63,10 @@ public class TextTableTest
|
|||
Column column = column("Centered", TextTable.Alignment.CENTER);
|
||||
column.fit(WIDTH_REFERENCE);
|
||||
|
||||
String paddedHeader = column.formatHeader("-");
|
||||
Assert.assertEquals("Centered header should be padded equally on both sides", "---Centered----", paddedHeader);
|
||||
String paddedReference = column.format(WIDTH_REFERENCE, "-");
|
||||
Assert.assertEquals("Centered reference should'nt be padded", WIDTH_REFERENCE, paddedReference);
|
||||
String paddedValue = column.format("Value", "-");
|
||||
Assert.assertEquals("Centered value should be padded equally on both sides", "-----Value-----", paddedValue);
|
||||
String paddedOffCenter = column.format("Value1", "-");
|
||||
Assert.assertNotEquals("Center padding should be left-biased", "-----Value1----", paddedOffCenter);
|
||||
assertEquals("---Centered----", column.formatHeader("-"), "Centered header should be padded equally on both sides");
|
||||
assertEquals(WIDTH_REFERENCE, column.format(WIDTH_REFERENCE, "-"), "Centered reference should'nt be padded");
|
||||
assertEquals("-----Value-----", column.format("Value", "-"), "Centered value should be padded equally on both sides");
|
||||
assertNotEquals("-----Value1----", column.format("Value1", "-"), "Center padding should be left-biased");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -82,12 +75,9 @@ public class TextTableTest
|
|||
Column column = column("Right", TextTable.Alignment.RIGHT);
|
||||
column.fit(WIDTH_REFERENCE);
|
||||
|
||||
String paddedHeader = column.formatHeader("-");
|
||||
Assert.assertEquals("Right-aligned header should be padded on the left", "----------Right", paddedHeader);
|
||||
String paddedReference = column.format(WIDTH_REFERENCE, "-");
|
||||
Assert.assertEquals("Right-aligned reference should'nt be padded", WIDTH_REFERENCE, paddedReference);
|
||||
String paddedValue = column.format("Value", "-");
|
||||
Assert.assertEquals("Right-aligned value should be padded on the left", "----------Value", paddedValue);
|
||||
assertEquals("----------Right", column.formatHeader("-"), "Right-aligned header should be padded on the left");
|
||||
assertEquals(WIDTH_REFERENCE, column.format(WIDTH_REFERENCE, "-"), "Right-aligned reference should'nt be padded");
|
||||
assertEquals("----------Value", column.format("Value", "-"), "Right-aligned value should be padded on the left");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -102,18 +92,11 @@ public class TextTableTest
|
|||
table.add("Value 1", "Long Value 2", "Value 3");
|
||||
table.add("Value 1", "Value 2", "Long Value 3");
|
||||
int[] columnWidths = table.getColumns().stream().mapToInt(Column::getWidth).toArray();
|
||||
Assert.assertArrayEquals("Column widths should adjust for long values", new int[]{12, 12, 12}, columnWidths);
|
||||
assertArrayEquals(new int[]{12, 12, 12}, columnWidths, "Column widths should adjust for long values");
|
||||
|
||||
String[] result = table.build("\n").split("\n");
|
||||
Assert.assertEquals("Header row + separator row + value rows should result in 5 lines", 5, result.length);
|
||||
Assert.assertEquals(
|
||||
"Column headers should be properly formatted",
|
||||
"| Left | Center | Right |",
|
||||
result[0]);
|
||||
Assert.assertEquals(
|
||||
"Header-body separators should contain markdown alignment information",
|
||||
"|:------------ |:------------:| ------------:|",
|
||||
result[1]
|
||||
);
|
||||
assertEquals(5, result.length, "Header row + separator row + value rows should result in 5 lines");
|
||||
assertEquals("| Left | Center | Right |", result[0], "Column headers should be properly formatted");
|
||||
assertEquals("|:------------ |:------------:| ------------:|", result[1], "Header-body separators should contain markdown alignment information");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue