Improve code format and remove some unneeded code
This commit is contained in:
@@ -15,7 +15,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
/**
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 04-16-2020
|
||||
* @version 08-31-2020
|
||||
*/
|
||||
@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
|
||||
public class Main
|
||||
|
||||
@@ -2,31 +2,42 @@ package backsun.lod.proxy;
|
||||
|
||||
import backsun.lod.renderer.CustomRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
/**
|
||||
* This is used by the client.
|
||||
*
|
||||
* @author James_Seibel
|
||||
* @version 08-31-2020
|
||||
*/
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
private CustomRenderer renderer;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public ClientProxy()
|
||||
{
|
||||
renderer = new CustomRenderer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemRender(Item item, int meta, String id)
|
||||
{
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==============//
|
||||
// render event //
|
||||
//==============//
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderWorldLastEvent(RenderWorldLastEvent event)
|
||||
@@ -34,6 +45,14 @@ public class ClientProxy extends CommonProxy
|
||||
renderer.drawTest(Minecraft.getMinecraft(), event.getPartialTicks());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//===============//
|
||||
// update events //
|
||||
//===============//
|
||||
|
||||
@SubscribeEvent
|
||||
public void fovUpdateEvent(FOVUpdateEvent event)
|
||||
{
|
||||
@@ -53,7 +72,6 @@ public class ClientProxy extends CommonProxy
|
||||
{
|
||||
int biome = Biome.getIdForBiome(ch.getBiome(new BlockPos(ch.x, 70, ch.z), mc.world.getBiomeProvider()));
|
||||
renderer.biomes[ch.x+32][ch.z+32] = biome;
|
||||
//System.out.println(renderer.biomes[ch.x+32][ch.z+32]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,9 +80,20 @@ public class ClientProxy extends CommonProxy
|
||||
}
|
||||
catch(IndexOutOfBoundsException e)
|
||||
{
|
||||
|
||||
// TODO fix so this isn't needed
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* this event is called whenever a chunk is created for the first time.
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void onChunkPopulate(PopulateChunkEvent event)
|
||||
{
|
||||
// later on this should save information about the chunk to be used later
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
package backsun.lod.proxy;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
/**
|
||||
* This is used by the server.
|
||||
*
|
||||
* @author James_Seibel
|
||||
* @version 08-31-2020
|
||||
*/
|
||||
public class CommonProxy
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @param item
|
||||
* @param meta
|
||||
* @param id
|
||||
*/
|
||||
public void registerItemRender(Item item, int meta, String id)
|
||||
{
|
||||
// nothing is needed here, only the clientProxy needs to have an implementation of this
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user