Merge pull request #1698 from MellowArpeggiation/push-ups

Upstream Space Shit
This commit is contained in:
HbmMods 2024-09-26 08:28:50 +02:00 committed by GitHub
commit 333c707a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 3677 additions and 3527 deletions

View File

@ -32,6 +32,7 @@ if(!mod_build_number.isEmpty()) {
group = "com.hbm" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "com.hbm" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "HBM-NTM" archivesBaseName = "HBM-NTM"
compileJava.options.encoding = 'UTF-8' compileJava.options.encoding = 'UTF-8'
compileJava.options.compilerArgs += '-proc:none'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
@ -75,6 +76,14 @@ repositories {
name = "gt" name = "gt"
url = "https://gregtech.mechaenetia.com/" url = "https://gregtech.mechaenetia.com/"
} }
maven {
name = 'FalsePattern'
url = "https://mvn.falsepattern.com/releases/"
}
maven {
name = "GitHub"
url = "https://jitpack.io"
}
//maven { //maven {
// name = "CurseForge" // name = "CurseForge"
// url = "https://minecraft.curseforge.com/api/maven/" // url = "https://minecraft.curseforge.com/api/maven/"
@ -94,6 +103,8 @@ dependencies {
compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf" compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"
compileOnly 'com.falsepattern:endlessids-mc1.7.10:1.5.4:dev'
} }
processResources { processResources {

View File

@ -1,5 +1,7 @@
package com.hbm.blocks; package com.hbm.blocks;
import java.util.ArrayList;
import com.hbm.blocks.BlockEnums.*; import com.hbm.blocks.BlockEnums.*;
import com.hbm.blocks.bomb.*; import com.hbm.blocks.bomb.*;
import com.hbm.blocks.fluid.*; import com.hbm.blocks.fluid.*;
@ -29,7 +31,10 @@ import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid; import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
@ -1305,7 +1310,7 @@ public class ModBlocks {
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F); stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
stone_biome = new BlockBiomeStone().setBlockName("stone_biome").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F); stone_biome = new BlockBiomeStone().setBlockName("stone_biome").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt"); basalt = new BlockPillar(Material.rock, RefStrings.MODID + ":basalt_top").setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
ore_basalt = new BlockOreBasalt().setBlockName("ore_basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_basalt"); ore_basalt = new BlockOreBasalt().setBlockName("ore_basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_basalt");
basalt_smooth = new BlockGeneric(Material.rock).setBlockName("basalt_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_smooth"); basalt_smooth = new BlockGeneric(Material.rock).setBlockName("basalt_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_smooth");
basalt_brick = new BlockGeneric(Material.rock).setBlockName("basalt_brick").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_brick"); basalt_brick = new BlockGeneric(Material.rock).setBlockName("basalt_brick").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_brick");
@ -3466,4 +3471,20 @@ public class ModBlocks {
Block remap = new BlockRemap(block, meta).setBlockName(unloc); Block remap = new BlockRemap(block, meta).setBlockName(unloc);
register(remap, ItemBlockRemap.class); register(remap, ItemBlockRemap.class);
} }
// Pretty much the default getDrops function but with no damage set on the item (fucks with recipes)
// but setting the meta via damageDropped breaks creative middle-click and any WAILA-like overlays
public static ArrayList<ItemStack> getDropsWithoutDamage(World world, Block block, int metadata, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
int count = block.quantityDropped(metadata, fortune, world.rand);
for(int i = 0; i < count; i++) {
Item item = block.getItemDropped(metadata, world.rand, fortune);
if(item != null) {
ret.add(new ItemStack(item, 1, 0));
}
}
return ret;
}
} }

View File

@ -1,5 +1,6 @@
package com.hbm.blocks.generic; package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
import java.util.Random; import java.util.Random;
@ -7,16 +8,23 @@ import com.hbm.blocks.BlockEnumMulti;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class BlockOreBasalt extends BlockEnumMulti { public class BlockOreBasalt extends BlockEnumMulti {
protected IIcon[] topIcons;
public BlockOreBasalt() { public BlockOreBasalt() {
super(Material.rock, EnumBasaltOreType.class, true, true); super(Material.rock, EnumBasaltOreType.class, true, true);
} }
@ -47,11 +55,6 @@ public class BlockOreBasalt extends BlockEnumMulti {
return super.getItemDropped(meta, rand, fortune); return super.getItemDropped(meta, rand, fortune);
} }
@Override
public int damageDropped(int meta) {
return 0;
}
@Override @Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) { public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
@ -76,4 +79,31 @@ public class BlockOreBasalt extends BlockEnumMulti {
if(meta == EnumBasaltOreType.ASBESTOS.ordinal()) world.setBlock(x, y, z, ModBlocks.gas_asbestos); if(meta == EnumBasaltOreType.ASBESTOS.ordinal()) world.setBlock(x, y, z, ModBlocks.gas_asbestos);
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune); super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune);
} }
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return ModBlocks.getDropsWithoutDamage(world, this, metadata, fortune);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
super.registerBlockIcons(reg);
Enum[] enums = theEnum.getEnumConstants();
this.topIcons = new IIcon[enums.length];
for(int i = 0; i < topIcons.length; i++) {
Enum num = enums[i];
this.topIcons[i] = reg.registerIcon(this.getTextureMultiName(num) + "_top");
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if(side <= 1) return this.topIcons[meta % this.topIcons.length];
return super.getIcon(side, meta);
}
} }

View File

@ -16,6 +16,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockScaffold extends BlockMulti { public class BlockScaffold extends BlockMulti {
@ -60,21 +61,33 @@ public class BlockScaffold extends BlockMulti {
return this.icons[this.damageDropped(meta)]; return this.icons[this.damageDropped(meta)];
} }
@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float fx, float fy, float fz, int meta) {
return side;
}
@Override @Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; ForgeDirection placed = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
int meta = stack.getItemDamage(); int meta = stack.getItemDamage();
if(i % 2 == 0) { if(placed == ForgeDirection.UP || placed == ForgeDirection.DOWN) {
world.setBlockMetadataWithNotify(x, y, z, meta, 2); int rot = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(rot % 2 == 0) {
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
} else {
world.setBlockMetadataWithNotify(x, y, z, meta + 8, 2);
}
} else if(placed == ForgeDirection.NORTH || placed == ForgeDirection.SOUTH) {
world.setBlockMetadataWithNotify(x, y, z, meta + 4, 2);
} else { } else {
world.setBlockMetadataWithNotify(x, y, z, meta + 8, 2); world.setBlockMetadataWithNotify(x, y, z, meta + 12, 2);
} }
} }
@Override @Override
public int damageDropped(int meta) { public int damageDropped(int meta) {
return rectify(meta) & 7; return rectify(meta);
} }
@Override @Override
@ -83,27 +96,24 @@ public class BlockScaffold extends BlockMulti {
} }
@Override @Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); int meta = world.getBlockMetadata(x, y, z);
float f = 0.0625F; float f = 0.0625F;
if((te & 8) != 0) if(meta >= 12) {
this.setBlockBounds(0.0F, 2 * f, 0.0F, 1.0F, 14 * f, 1.0F);
} else if(meta >= 8) {
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F); this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
else } else if(meta >= 4) {
this.setBlockBounds(0.0F, 2 * f, 0.0F, 1.0F, 14 * f, 1.0F);
} else {
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f); this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
}
} }
@Override @Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
setBlockBoundsBasedOnState(world, x, y, z);
int te = world.getBlockMetadata(x, y, z);
float f = 0.0625F;
if((te & 8) != 0)
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
else
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
} }
} }

View File

@ -1,5 +1,6 @@
package com.hbm.blocks.generic; package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import com.hbm.blocks.BlockEnumMulti; import com.hbm.blocks.BlockEnumMulti;
@ -10,6 +11,7 @@ import com.hbm.items.ModItems;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@ -46,11 +48,6 @@ public class BlockStalagmite extends BlockEnumMulti {
return null; return null;
} }
@Override
public int damageDropped(int meta) {
return 0;
}
public static int getMetaFromResource(int meta) { public static int getMetaFromResource(int meta) {
return meta; return meta;
} }
@ -75,4 +72,10 @@ public class BlockStalagmite extends BlockEnumMulti {
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null; return null;
} }
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return ModBlocks.getDropsWithoutDamage(world, this, metadata, fortune);
}
} }

View File

@ -1,5 +1,9 @@
package com.hbm.packet.toclient; package com.hbm.packet.toclient;
import cpw.mods.fml.common.Loader;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import com.hbm.util.Compat;
import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.common.network.simpleimpl.MessageContext;
@ -16,18 +20,26 @@ public class BiomeSyncPacket implements IMessage {
int chunkZ; int chunkZ;
byte blockX; byte blockX;
byte blockZ; byte blockZ;
byte biome; short biome;
byte[] biomeArray; short[] biomeArray;
public BiomeSyncPacket() { } public BiomeSyncPacket() { }
public BiomeSyncPacket(int chunkX, int chunkZ, byte[] biomeArray) { public BiomeSyncPacket(int chunkX, int chunkZ, byte[] biomeArray) {
this(chunkX, chunkZ, bytesToShorts(biomeArray));
}
public BiomeSyncPacket(int blockX, int blockZ, byte biome) {
this(blockX, blockZ, (short) biome);
}
public BiomeSyncPacket(int chunkX, int chunkZ, short[] biomeArray) {
this.chunkX = chunkX; this.chunkX = chunkX;
this.chunkZ = chunkZ; this.chunkZ = chunkZ;
this.biomeArray = biomeArray; this.biomeArray = biomeArray;
} }
public BiomeSyncPacket(int blockX, int blockZ, byte biome) { public BiomeSyncPacket(int blockX, int blockZ, short biome) {
this.chunkX = blockX >> 4; this.chunkX = blockX >> 4;
this.chunkZ = blockZ >> 4; this.chunkZ = blockZ >> 4;
this.blockX = (byte) (blockX & 15); this.blockX = (byte) (blockX & 15);
@ -42,13 +54,13 @@ public class BiomeSyncPacket implements IMessage {
if(this.biomeArray == null) { if(this.biomeArray == null) {
buf.writeBoolean(false); buf.writeBoolean(false);
buf.writeByte(this.biome); buf.writeShort(this.biome);
buf.writeByte(this.blockX); buf.writeByte(this.blockX);
buf.writeByte(this.blockZ); buf.writeByte(this.blockZ);
} else { } else {
buf.writeBoolean(true); buf.writeBoolean(true);
for(int i = 0; i < 256; i++) { for(int i = 0; i < 256; i++) {
buf.writeByte(this.biomeArray[i]); buf.writeShort(this.biomeArray[i]);
} }
} }
} }
@ -59,17 +71,27 @@ public class BiomeSyncPacket implements IMessage {
this.chunkZ = buf.readInt(); this.chunkZ = buf.readInt();
if(!buf.readBoolean()) { if(!buf.readBoolean()) {
this.biome = buf.readByte(); this.biome = buf.readShort();
this.blockX = buf.readByte(); this.blockX = buf.readByte();
this.blockZ = buf.readByte(); this.blockZ = buf.readByte();
} else { } else {
this.biomeArray = new byte[256]; this.biomeArray = new short[256];
for(int i = 0; i < 256; i++) { for(int i = 0; i < 256; i++) {
this.biomeArray[i] = buf.readByte(); this.biomeArray[i] = buf.readShort();
} }
} }
} }
private final static short[] bytesToShorts(byte[] byteArray) {
int size = byteArray.length;
short[] shortArray = new short[size];
for(int index = 0; index < size; index++)
shortArray[index] = (short) byteArray[index];
return shortArray;
}
public static class Handler implements IMessageHandler<BiomeSyncPacket, IMessage> { public static class Handler implements IMessageHandler<BiomeSyncPacket, IMessage> {
@Override @Override
@ -81,13 +103,27 @@ public class BiomeSyncPacket implements IMessage {
Chunk chunk = world.getChunkFromChunkCoords(m.chunkX, m.chunkZ); Chunk chunk = world.getChunkFromChunkCoords(m.chunkX, m.chunkZ);
chunk.isModified = true; chunk.isModified = true;
if(m.biomeArray == null) { if(Loader.isModLoaded(Compat.MOD_EIDS)) {
chunk.getBiomeArray()[(m.blockZ & 15) << 4 | (m.blockX & 15)] = m.biome; if (m.biomeArray == null) {
world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, m.chunkX << 4, 255, m.chunkZ << 4); ChunkBiomeHook hook = (ChunkBiomeHook) chunk;
hook.getBiomeShortArray()[(m.blockZ & 15) << 4 | m.blockX & 15] = m.biome;
world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, m.chunkX << 4, 255, m.chunkZ << 4);
} else {
for (int i = 0; i < 255; ++i) {
ChunkBiomeHook hook = (ChunkBiomeHook) chunk;
hook.getBiomeShortArray()[i] = m.biomeArray[i];
world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, (m.chunkX << 4) + 15, 255, (m.chunkZ << 4) + 15);
}
}
} else { } else {
for(int i = 0; i < 256; i++) { if(m.biomeArray == null) {
chunk.getBiomeArray()[i] = m.biomeArray[i]; chunk.getBiomeArray()[(m.blockZ & 15) << 4 | (m.blockX & 15)] = (byte) m.biome;
world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, (m.chunkX << 4) + 15, 255, (m.chunkZ << 4) + 15); world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, m.chunkX << 4, 255, m.chunkZ << 4);
} else {
for(int i = 0; i < 256; i++) {
chunk.getBiomeArray()[i] = (byte) m.biomeArray[i];
world.markBlockRangeForRenderUpdate(m.chunkX << 4, 0, m.chunkZ << 4, (m.chunkX << 4) + 15, 255, (m.chunkZ << 4) + 15);
}
} }
} }

View File

@ -49,14 +49,31 @@ public class RenderScaffoldBlock implements ISimpleBlockRenderingHandler {
iicon = renderer.overrideBlockTexture; iicon = renderer.overrideBlockTexture;
} }
float rotation = (float) -Math.PI; float ox = x + 0.5F;
float oy = y;
float oz = z + 0.5F;
if((world.getBlockMetadata(x, y, z) & 8) == 0) float rotation = (float) Math.PI * -0.5F;
rotation = -90F / 180F * (float) Math.PI; float pitch = 0;
tessellator.addTranslation(x + 0.5F, y, z + 0.5F); int meta = world.getBlockMetadata(x, y, z);
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.scaffold, iicon, tessellator, rotation, true);
tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); if(meta >= 12) {
pitch = (float) Math.PI * 0.5F;
rotation = (float) -Math.PI;
ox = x + 1.0F;
oy = y + 0.5F;
} else if(meta >= 8) {
rotation = (float) -Math.PI;
} else if(meta >= 4) {
pitch = (float) Math.PI * 0.5F;
oy = y + 0.5F;
oz = z;
}
tessellator.addTranslation(ox, oy, oz);
ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.scaffold, iicon, tessellator, rotation, pitch, true);
tessellator.addTranslation(-ox, -oy, -oz);
return true; return true;
} }

View File

@ -76,6 +76,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer implements IItemR
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix(); GL11.glPopMatrix();
RenderHelper.enableStandardItemLighting(); RenderHelper.enableStandardItemLighting();
} }

View File

@ -35,6 +35,7 @@ public class Compat {
public static final String MOD_TIC = "TConstruct"; public static final String MOD_TIC = "TConstruct";
public static final String MOD_RC = "Railcraft"; public static final String MOD_RC = "Railcraft";
public static final String MOD_TC = "tc"; public static final String MOD_TC = "tc";
public static final String MOD_EIDS = "endlessids";
public static Item tryLoadItem(String domain, String name) { public static Item tryLoadItem(String domain, String name) {
return (Item) Item.itemRegistry.getObject(getReg(domain, name)); return (Item) Item.itemRegistry.getObject(getReg(domain, name));

View File

@ -2,7 +2,9 @@ package com.hbm.world;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.BiomeSyncPacket; import com.hbm.packet.toclient.BiomeSyncPacket;
import com.hbm.util.Compat;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
@ -21,19 +23,33 @@ public class WorldUtil {
public static void setBiome(World world, int x, int z, BiomeGenBase biome) { public static void setBiome(World world, int x, int z, BiomeGenBase biome) {
Chunk chunk = world.getChunkFromBlockCoords(x, z); Chunk chunk = world.getChunkFromBlockCoords(x, z);
chunk.getBiomeArray()[(z & 15) << 4 | (x & 15)] = (byte)(biome.biomeID & 255); if(Loader.isModLoaded(Compat.MOD_EIDS)) {
short[] array = ((ChunkBiomeHook) chunk).getBiomeShortArray();
array[(z & 15) << 4 | x & 15] = (short) biome.biomeID;
} else {
chunk.getBiomeArray()[(z & 15) << 4 | (x & 15)] = (byte)(biome.biomeID & 255);
}
chunk.isModified = true; chunk.isModified = true;
} }
public static void syncBiomeChange(World world, int x, int z) { public static void syncBiomeChange(World world, int x, int z) {
Chunk chunk = world.getChunkFromBlockCoords(x, z); Chunk chunk = world.getChunkFromBlockCoords(x, z);
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x >> 4, z >> 4, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D)); if(Loader.isModLoaded(Compat.MOD_EIDS)) {
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x >> 4, z >> 4, ((ChunkBiomeHook) chunk).getBiomeShortArray()), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D));
} else {
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x >> 4, z >> 4, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D));
}
} }
public static void syncBiomeChangeBlock(World world, int x, int z) { public static void syncBiomeChangeBlock(World world, int x, int z) {
Chunk chunk = world.getChunkFromBlockCoords(x, z); Chunk chunk = world.getChunkFromBlockCoords(x, z);
byte biome = chunk.getBiomeArray()[(z & 15) << 4 | (x & 15)]; if(Loader.isModLoaded(Compat.MOD_EIDS)) {
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x, z, biome), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D)); short biome = ((ChunkBiomeHook) chunk).getBiomeShortArray()[(z & 15) << 4 | (x & 15)];
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x, z, biome), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D));
} else {
byte biome = chunk.getBiomeArray()[(z & 15) << 4 | (x & 15)];
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x, z, biome), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D));
}
} }
public static void syncBiomeChange(World world, Chunk chunk) { public static void syncBiomeChange(World world, Chunk chunk) {
@ -48,7 +64,11 @@ public class WorldUtil {
/* this sucks ass */ /* this sucks ass */
ChunkCoordIntPair coord = chunk.getChunkCoordIntPair(); ChunkCoordIntPair coord = chunk.getChunkCoordIntPair();
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(coord.chunkXPos, coord.chunkZPos, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, coord.getCenterXPos(), 128, coord.getCenterZPosition() /* who named you? */, 1024D)); if(Loader.isModLoaded(Compat.MOD_EIDS)) {
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(coord.chunkXPos, coord.chunkZPos, ((ChunkBiomeHook) chunk).getBiomeShortArray()), new TargetPoint(world.provider.dimensionId, coord.getCenterXPos(), 128, coord.getCenterZPosition() /* who named you? */, 1024D));
} else {
PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(coord.chunkXPos, coord.chunkZPos, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, coord.getCenterXPos(), 128, coord.getCenterZPosition() /* who named you? */, 1024D));
}
} }
/**Chunkloads the chunk the entity is going to spawn in and then spawns it /**Chunkloads the chunk the entity is going to spawn in and then spawns it

Binary file not shown.

Before

Width:  |  Height:  |  Size: 893 B

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 929 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB