Fixed server crashing (Again!)

This commit is contained in:
Adubbz 2015-05-02 14:27:39 +10:00
parent ee2fd6ab6d
commit e29bae36ed
5 changed files with 29 additions and 6 deletions

View file

@ -1,5 +1,5 @@
minecraft_version=1.8
forge_version=11.14.1.1322
forge_version=11.14.1.1397
mod_version=3.0.0
curse_project_id=220318
curse_release_type=alpha

View file

@ -201,11 +201,8 @@ public class ModBlocks
public static Block registerFluidBlock(Fluid fluid, BlockFluidBase fluidBlock, String name)
{
Block block = GameRegistry.registerBlock(fluidBlock, null, name);
// use a custom state mapper which will ignore the LEVEL property
IStateMapper custom_mapper = (new StateMap.Builder()).addPropertiesToIgnore(new IProperty[] {BlockFluidBase.LEVEL}).build();
ModelLoader.setCustomStateMapper(block, custom_mapper);
BiomesOPlenty.proxy.registerFluidBlockRendering(block, name);
fluid.setBlock(fluidBlock);
ModelBakeHandler.fluidsToTextureStitch.add(name);
return block;
}

View file

@ -9,6 +9,9 @@
package biomesoplenty.common.init;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import biomesoplenty.client.handler.ModelBakeHandler;
import biomesoplenty.common.handler.DyeEventHandler;
import biomesoplenty.common.handler.GuiEventHandler;
@ -24,8 +27,18 @@ public class ModHandlers
DecorateBiomeEventHandler decorateBiomeHandler = new DecorateBiomeEventHandler();
MinecraftForge.EVENT_BUS.register(decorateBiomeHandler);
MinecraftForge.TERRAIN_GEN_BUS.register(decorateBiomeHandler);
MinecraftForge.EVENT_BUS.register(new DyeEventHandler());
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
{
registerClientEvents();
}
}
@SideOnly(Side.CLIENT)
private static void registerClientEvents()
{
MinecraftForge.EVENT_BUS.register(new ModelBakeHandler());
MinecraftForge.EVENT_BUS.register(new GuiEventHandler());
MinecraftForge.EVENT_BUS.register(new DyeEventHandler());
}
}

View file

@ -23,9 +23,11 @@ import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.api.particle.BOPParticleTypes;
import biomesoplenty.client.handler.ModelBakeHandler;
import biomesoplenty.client.particle.*;
import biomesoplenty.common.config.MiscConfigurationHandler;
import biomesoplenty.common.entities.EntityPixie;
@ -84,6 +86,15 @@ public class ClientProxy extends CommonProxy
}
}
@Override
public void registerFluidBlockRendering(Block block, String name)
{
// use a custom state mapper which will ignore the LEVEL property
IStateMapper custom_mapper = (new StateMap.Builder()).addPropertiesToIgnore(new IProperty[] {BlockFluidBase.LEVEL}).build();
ModelLoader.setCustomStateMapper(block, custom_mapper);
ModelBakeHandler.fluidsToTextureStitch.add(name);
}
@Override
public void spawnParticle(BOPParticleTypes type, double x, double y, double z)
{

View file

@ -11,6 +11,7 @@ package biomesoplenty.core;
import biomesoplenty.api.particle.BOPParticleTypes;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.fluids.BlockFluidBase;
public class CommonProxy
@ -18,5 +19,6 @@ public class CommonProxy
public void registerRenderers() {}
public void registerItemVariantModel(Item item, String name, int metadata) {}
public void registerNonRenderingProperties(Block block) {}
public void registerFluidBlockRendering(Block block, String name) {}
public void spawnParticle(BOPParticleTypes type, double x, double y, double z) {}
}