Jump to content

[1.12.2] Rendering Custom Throwable Entity Crashes Minecraft


PhilipChonacky

Recommended Posts

Hello,

 

I recently started modding 1.12.2 (from 1.7), and I'm trying to recode older (simple) mods to try and learn the newer methods.

In 1.7, I created a custom throwable grenade by creating a simple ItemGrenade (Extending Item class) and an associated EntityGrenade (Extending EntityThrowable), then registering RenderSnowball w/ reference to the ItemGrenade (for texture).

 

I tried a similar approach in 1.12.2, but Minecraft crashes with a Null pointer exception as soon as the grenade is thrown.

 

Here's the code details:

 

1. Create ItemGrenade

public class ItemGrenade extends Item {

	public ItemGrenade() {
		this.setRegistryName("grenade");
		this.setUnlocalizedName("Grenade");
		this.setCreativeTab(CreativeTabs.COMBAT);
		this.setMaxStackSize(18);
	
	}
	
	public ModelResourceLocation getModelResourceLocation() {
		return new ModelResourceLocation(this.getRegistryName().toString());
	}
	
	
	/**
	* Called whenever this item is equipped and the right mouse button is pressed.
	* @param: itemStack, world, entityPlayer
	*/
	@Override
	public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
			EnumHand handIn) {
//		if (!player.capabilities.isCreativeMode) { stack.setCount(stack.getCount()-1);   }


		// IMPORTANT! Only spawn new entities on the server. If the world is not remote,
		// that means you are on the server:
		if (!world.isRemote) {
			world.spawnEntity(new EntityGrenade(world, player)); }

		return super.onItemRightClick(world, player, handIn);
	}

}

 

2. Create EntityGrenade:

public class EntityGrenade extends EntityThrowable {
	
	private int fuse;

	//not used
	public EntityGrenade(World world) {
		super(world);
	}

	public EntityGrenade(World world, EntityLivingBase player) {
		super(world, player);
		this.fuse = 20;
		this.noClip=true;

	}

	//not used
	public EntityGrenade(World worldIn, double posX,
			double posY, double posZ) {
		super(worldIn, posX, posY, posZ);
	}



	@Override
	public void onUpdate() {
		super.onUpdate();

//	For troubleshooting		
//		System.out.println(">>>>>Motion X = " + this.motionX);
//		System.out.println(">>>>>Motion Y = " + this.motionY);
//		System.out.println(">>>>>Motion Z = " + this.motionZ);

//Decrement Fuse		
		this.fuse--;
		
//Blow up if fuse is 0
		if (this.fuse <= 0){
			for (int i = 0; i < 8; ++i) {		
				//EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters)
				this.world.spawnParticle(EnumParticleTypes.CLOUD, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
			}
			if (!this.world.isRemote) {
				this.world.newExplosion(this, this.posX, this.posY, this.posZ, 1.5F, false, true);
				this.setDead();
			}
		}
	}

//stop if grenade hits something	
	@Override
	protected void onImpact(RayTraceResult movObjPos) {
		if ((movObjPos.entityHit != null) && (!this.world.isRemote)) { 
			movObjPos.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) this.getThrower()),1);
			this.posX = movObjPos.entityHit.posX;
			this.posY = movObjPos.entityHit.posY+0.01F;
			this.posZ = movObjPos.entityHit.posZ;
			this.motionX=0F;
			this.motionY=0F;
			this.motionZ=0F;
			
		}
		else { //didn't hit an entity (hit a block)
	//Bounce Grenade
	//Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1,  
	//			East = 2, West = 3, North = 4, South = 5.
				if ( movObjPos.sideHit == EnumFacing.UP) { //top hit

		            this.motionX *= 0.699999988079071D;
		            this.motionZ *= 0.699999988079071D;
		            this.motionY *= -0.5D;
				}
				else { 
					if ( (movObjPos.sideHit == EnumFacing.EAST) || (movObjPos.sideHit == EnumFacing.WEST)) { // east/west hit
					this.motionZ = -(0.9 * this.motionZ);
					}
					else { 
						if ( (movObjPos.sideHit == EnumFacing.NORTH) || (movObjPos.sideHit == EnumFacing.SOUTH)) {// north/south hit
							this.motionX = -(0.9 * this.motionX);
						}
						else {
							if (movObjPos.sideHit == EnumFacing.DOWN) { //bottom hit
								this.motionY = -(0.9 * this.motionY);
							}
							else {
								return; /// none of the above
							}
						}
					}
				}	
	}
	}	
}

 

3. Register the item, entity, and renderer (RenderSnowball)

   @EventHandler 
    public void preInit(FMLPreInitializationEvent event){

	itemGrenade = (ItemGrenade)(new ItemGrenade());
	ForgeRegistries.ITEMS.register(itemGrenade);
	entityGrenade = EntityEntryBuilder.create()
			.entity(EntityGrenade.class)
			.id("grenade", ID++)
		    .tracker(64, 20, false)
			.name("grenade")
			.build();
	ForgeRegistries.ENTITIES.register(entityGrenade);
	
	// required in order for the renderer to know how to render your item. (CLIENT ONLY)
	final int DEFAULT_ITEM_SUBTYPE = 0;
	ModelLoader.setCustomModelResourceLocation(itemGrenade, DEFAULT_ITEM_SUBTYPE, itemGrenade.getModelResourceLocation());
	  
	
	Minecraft mcIn = Minecraft.getMinecraft();
 	RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new IRenderFactory <EntityGrenade>() {
		@Override
		public Render createRenderFor(RenderManager manager) 
		{
			return (Render)new RenderSnowball<Entity>(mcIn.getRenderManager(), itemGrenade, mcIn.getRenderItem());
		}		
	});
}

 

...and yes, I know I combined Client and non-client code here, I'm keeping it simple for now [and only testing in Client so I can work out the bugs.

 

Here's the crash error:

[18:13:55] [main/FATAL] [net.minecraft.client.Minecraft]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering entity in world
	at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:432) ~[RenderManager.class:?]
	at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:374) ~[RenderManager.class:?]
	at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:655) ~[RenderGlobal.class:?]
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1398) ~[EntityRenderer.class:?]
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312) ~[EntityRenderer.class:?]
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115) ~[EntityRenderer.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.lang.NullPointerException
	at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:35) ~[RenderSnowball.class:?]
	at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:390) ~[RenderManager.class:?]
	... 20 more
[18:13:55] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Why is it breaking :(

Time: 9/14/18 6:13 PM
Description: Rendering entity in world

java.lang.NullPointerException: Rendering entity in world
	at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:35)
	at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:390)
	at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:374)
	at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:655)
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1398)
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312)
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207)
	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:35)

-- Entity being rendered --
Details:
	Entity Type: grenadier:grenade (net.chonacky.minecraft.mod.grenadier.EntityGrenade)
	Entity ID: 1048
	Entity Name: entity.grenade.name
	Entity's Exact location: 231.74, 76.63, -136.82
	Entity's Block location: World: (231,76,-137), Chunk: (at 7,4,7 in 14,-9; contains blocks 224,0,-144 to 239,255,-129), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
	Entity's Momentum: 0.00, -0.03, 0.00
	Entity's Passengers: []
	Entity's Vehicle: ~~ERROR~~ NullPointerException: null

-- Renderer details --
Details:
	Assigned renderer: net.minecraft.client.renderer.entity.RenderSnowball@4f6fe1c9
	Location: 0.00,1.52,0.00 - World: (0,1,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Rotation: 0.0
	Delta: 0.75999975
Stacktrace:
	at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:390)
	at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:374)
	at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:655)
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1398)
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player472'/250, l='MpServer', x=231.74, y=75.11, z=-136.82]]
	Chunk stats: MultiplayerChunkCache: 625, 625
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (-36,64,56), Chunk: (at 12,4,8 in -3,3; contains blocks -48,0,48 to -33,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 43339 game time, 1575 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 172 total; [EntityItem['item.tile.sand.default'/256, l='MpServer', x=236.77, y=65.00, z=-131.35], EntityItem['item.tile.sand.default'/257, l='MpServer', x=236.83, y=68.00, z=-135.38], EntityItem['item.tile.sand.default'/258, l='MpServer', x=234.94, y=68.00, z=-134.76], EntityItem['item.tile.sand.default'/259, l='MpServer', x=238.13, y=68.00, z=-133.65], EntitySpider['Spider'/1030, l='MpServer', x=223.50, y=14.00, z=-158.50], EntityRabbit['Rabbit'/527, l='MpServer', x=277.55, y=77.00, z=-64.50], EntityRabbit['Rabbit'/530, l='MpServer', x=291.52, y=79.00, z=-97.93], EntityRabbit['Rabbit'/536, l='MpServer', x=286.52, y=71.00, z=-101.98], EntityGrenade['entity.grenade.name'/1048, l='MpServer', x=231.74, y=76.63, z=-136.82], EntityWitch['Witch'/541, l='MpServer', x=299.50, y=34.00, z=-137.50], EntityRabbit['Rabbit'/543, l='MpServer', x=297.04, y=63.00, z=-129.50], EntityBat['Bat'/546, l='MpServer', x=280.52, y=16.10, z=-116.24], EntityBat['Bat'/547, l='MpServer', x=272.25, y=36.10, z=-116.45], EntityRabbit['Rabbit'/548, l='MpServer', x=274.05, y=69.00, z=-122.43], EntityCreeper['Creeper'/552, l='MpServer', x=299.50, y=16.00, z=-148.50], EntityRabbit['Rabbit'/555, l='MpServer', x=307.46, y=69.00, z=-57.23], EntityRabbit['Rabbit'/557, l='MpServer', x=311.23, y=69.00, z=-60.06], EntityBat['Bat'/301, l='MpServer', x=153.43, y=21.40, z=-203.35], EntityRabbit['Rabbit'/572, l='MpServer', x=292.51, y=73.00, z=-73.52], EntityRabbit['Rabbit'/574, l='MpServer', x=289.63, y=78.00, z=-87.41], EntityRabbit['Rabbit'/575, l='MpServer', x=288.51, y=80.00, z=-91.35], EntityCreeper['Creeper'/320, l='MpServer', x=217.17, y=24.00, z=-184.52], EntityCreeper['Creeper'/321, l='MpServer', x=223.17, y=21.00, z=-188.47], EntitySkeleton['Skeleton'/322, l='MpServer', x=214.76, y=23.00, z=-188.46], EntityZombie['Zombie'/323, l='MpServer', x=217.51, y=30.00, z=-179.83], EntityRabbit['Rabbit'/324, l='MpServer', x=221.48, y=63.00, z=-182.22], EntityVillager['Villager'/325, l='MpServer', x=211.70, y=63.00, z=-186.52], EntityVillager['Villager'/326, l='MpServer', x=209.72, y=63.00, z=-185.45], EntityBat['Bat'/329, l='MpServer', x=172.76, y=46.34, z=-196.43], EntityRabbit['Rabbit'/335, l='MpServer', x=166.72, y=65.00, z=-186.53], EntityZombie['Zombie'/336, l='MpServer', x=217.64, y=40.00, z=-193.17], EntityVillager['Villager'/337, l='MpServer', x=212.30, y=66.00, z=-196.70], EntityVillager['Villager'/338, l='MpServer', x=231.30, y=63.00, z=-201.76], EntityRabbit['Rabbit'/341, l='MpServer', x=182.93, y=65.00, z=-167.49], EntitySkeleton['Skeleton'/342, l='MpServer', x=162.73, y=37.00, z=-176.53], EntitySkeleton['Skeleton'/343, l='MpServer', x=161.50, y=33.00, z=-169.50], EntityCreeper['Creeper'/344, l='MpServer', x=184.50, y=31.00, z=-180.50], EntitySkeleton['Skeleton'/345, l='MpServer', x=180.29, y=28.00, z=-188.53], EntityCreeper['Creeper'/346, l='MpServer', x=202.84, y=21.00, z=-198.59], EntitySkeleton['Skeleton'/347, l='MpServer', x=195.50, y=35.00, z=-192.50], EntitySkeleton['Skeleton'/348, l='MpServer', x=205.50, y=32.00, z=-202.50], EntityRabbit['Rabbit'/351, l='MpServer', x=218.27, y=72.00, z=-83.48], EntityRabbit['Rabbit'/353, l='MpServer', x=207.77, y=67.00, z=-89.44], EntitySkeleton['Skeleton'/361, l='MpServer', x=231.28, y=16.00, z=-155.48], EntityCreeper['Creeper'/362, l='MpServer', x=234.68, y=25.00, z=-153.33], EntityCreeper['Creeper'/363, l='MpServer', x=228.50, y=37.00, z=-155.50], EntityItem['item.item.seeds'/364, l='MpServer', x=234.84, y=64.00, z=-159.14], EntityItem['item.tile.sand.default'/365, l='MpServer', x=238.13, y=65.00, z=-157.18], EntityItem['item.tile.sand.default'/366, l='MpServer', x=239.79, y=65.00, z=-159.05], EntityItem['item.tile.sand.default'/367, l='MpServer', x=239.58, y=65.00, z=-157.38], EntityItem['item.tile.sand.default'/368, l='MpServer', x=238.37, y=65.00, z=-155.90], EntityItem['item.tile.sand.default'/369, l='MpServer', x=239.16, y=65.00, z=-156.44], EntitySkeleton['Skeleton'/881, l='MpServer', x=155.50, y=35.00, z=-190.50], EntityItem['item.tile.sand.default'/370, l='MpServer', x=237.27, y=65.00, z=-155.13], EntityItem['item.tile.sand.default'/371, l='MpServer', x=238.20, y=65.00, z=-154.13], EntityItem['item.tile.sand.default'/372, l='MpServer', x=236.13, y=66.00, z=-155.59], EntitySkeleton['Skeleton'/888, l='MpServer', x=228.50, y=19.00, z=-153.50], EntityBat['Bat'/385, l='MpServer', x=258.53, y=41.05, z=-128.55], EntityRabbit['Rabbit'/386, l='MpServer', x=218.25, y=69.00, z=-72.53], EntityItem['item.tile.sand.default'/392, l='MpServer', x=248.32, y=66.00, z=-110.13], EntityItem['item.tile.sandStone.default'/394, l='MpServer', x=248.25, y=66.00, z=-110.65], EntityZombie['Zombie'/906, l='MpServer', x=303.50, y=28.00, z=-188.50], EntityItem['item.tile.sandStone.default'/395, l='MpServer', x=245.54, y=65.00, z=-111.17], EntityItem['item.tile.sandStone.default'/396, l='MpServer', x=246.13, y=64.00, z=-111.72], EntityItem['item.tile.sandStone.default'/397, l='MpServer', x=246.27, y=64.00, z=-110.81], EntityItem['item.tile.sand.default'/398, l='MpServer', x=245.66, y=65.00, z=-110.13], EntityItem['item.tile.sand.default'/399, l='MpServer', x=247.88, y=65.00, z=-111.46], EntitySkeleton['Skeleton'/402, l='MpServer', x=280.46, y=18.00, z=-209.27], EntityRabbit['Rabbit'/403, l='MpServer', x=280.72, y=63.00, z=-212.97], EntitySkeleton['Skeleton'/404, l='MpServer', x=239.50, y=35.00, z=-163.73], EntityItem['item.item.seeds'/405, l='MpServer', x=236.83, y=63.94, z=-164.68], EntityItem['item.item.seeds'/406, l='MpServer', x=235.50, y=63.94, z=-163.85], EntityCreeper['Creeper'/918, l='MpServer', x=260.50, y=13.00, z=-110.50], EntityItem['item.item.seeds'/407, l='MpServer', x=237.19, y=64.00, z=-165.83], EntityItem['item.item.seeds'/408, l='MpServer', x=234.38, y=64.00, z=-163.03], EntityRabbit['Rabbit'/409, l='MpServer', x=228.31, y=67.28, z=-168.67], EntityRabbit['Rabbit'/410, l='MpServer', x=239.60, y=63.94, z=-170.49], EntityCreeper['Creeper'/411, l='MpServer', x=219.52, y=19.00, z=-145.17], EntityItem['item.item.dyePowder.black'/412, l='MpServer', x=213.58, y=47.00, z=-158.71], EntityVillager['Villager'/413, l='MpServer', x=258.53, y=63.00, z=-194.34], EntitySquid['Squid'/415, l='MpServer', x=244.40, y=63.57, z=-187.60], EntitySquid['Squid'/416, l='MpServer', x=244.40, y=59.24, z=-186.40], EntitySquid['Squid'/417, l='MpServer', x=245.60, y=61.88, z=-187.60], EntitySkeleton['Skeleton'/929, l='MpServer', x=311.50, y=14.00, z=-103.50], EntityVillager['Villager'/421, l='MpServer', x=246.50, y=63.00, z=-202.93], EntityCreeper['Creeper'/423, l='MpServer', x=225.52, y=20.00, z=-182.18], EntityVillager['Villager'/424, l='MpServer', x=239.37, y=64.00, z=-190.51], EntityVillager['Villager'/425, l='MpServer', x=232.45, y=64.00, z=-176.46], EntityVillager['Villager'/426, l='MpServer', x=228.08, y=64.00, z=-187.33], EntitySkeleton['Skeleton'/427, l='MpServer', x=220.50, y=30.00, z=-164.50], EntityCreeper['Creeper'/428, l='MpServer', x=218.48, y=46.00, z=-165.77], EntityCreeper['Creeper'/429, l='MpServer', x=214.50, y=43.00, z=-170.50], EntityItem['item.item.dyePowder.black'/430, l='MpServer', x=210.81, y=45.00, z=-165.97], EntityRabbit['Rabbit'/431, l='MpServer', x=234.35, y=63.00, z=-196.43], EntityCreeper['Creeper'/943, l='MpServer', x=239.50, y=17.00, z=-157.50], EntityRabbit['Rabbit'/432, l='MpServer', x=226.89, y=63.00, z=-206.17], EntityVillager['Villager'/436, l='MpServer', x=224.50, y=64.00, z=-213.93], EntitySkeleton['Skeleton'/440, l='MpServer', x=256.45, y=38.00, z=-135.16], EntitySkeleton['Skeleton'/441, l='MpServer', x=258.27, y=39.00, z=-135.51], EntityBat['Bat'/442, l='MpServer', x=253.80, y=39.06, z=-136.90], EntityBat['Bat'/443, l='MpServer', x=257.57, y=41.70, z=-128.58], EntityBat['Bat'/444, l='MpServer', x=258.46, y=52.10, z=-132.30], EntityItem['item.tile.sandStone.default'/445, l='MpServer', x=245.88, y=62.00, z=-115.67], EntityItem['item.tile.sand.default'/447, l='MpServer', x=242.13, y=67.00, z=-114.59], EntityItem['item.tile.sand.default'/448, l='MpServer', x=241.96, y=70.00, z=-116.49], EntityItem['item.tile.sand.default'/449, l='MpServer', x=243.34, y=69.00, z=-116.88], EntityItem['item.tile.sandStone.default'/450, l='MpServer', x=247.88, y=65.00, z=-112.72], EntityItem['item.tile.sandStone.default'/451, l='MpServer', x=246.76, y=65.00, z=-112.02], EntityItem['item.tile.sand.default'/452, l='MpServer', x=242.45, y=67.00, z=-115.62], EntityItem['item.tile.sand.default'/453, l='MpServer', x=242.13, y=67.00, z=-113.79], EntityItem['item.tile.sand.default'/454, l='MpServer', x=244.68, y=67.00, z=-115.01], EntityEnderman['Enderman'/455, l='MpServer', x=285.15, y=63.00, z=-156.46], EntityRabbit['Rabbit'/456, l='MpServer', x=234.90, y=70.27, z=-102.52], EntitySpider['Spider'/457, l='MpServer', x=308.17, y=29.00, z=-192.02], EntitySkeleton['Skeleton'/969, l='MpServer', x=190.50, y=35.00, z=-199.50], EntitySkeleton['Skeleton'/458, l='MpServer', x=305.34, y=31.00, z=-196.53], EntityItem['item.tile.sandStone.default'/459, l='MpServer', x=232.96, y=63.00, z=-121.17], EntityItem['item.tile.sandStone.default'/460, l='MpServer', x=232.88, y=60.00, z=-125.88], EntityItem['item.tile.sandStone.default'/461, l='MpServer', x=233.14, y=62.00, z=-121.13], EntityItem['item.tile.sandStone.default'/462, l='MpServer', x=232.13, y=60.00, z=-124.24], EntityItem['item.tile.sandStone.default'/463, l='MpServer', x=232.65, y=63.00, z=-126.88], EntityItem['item.tile.sandStone.default'/464, l='MpServer', x=233.88, y=62.00, z=-125.88], EntityItem['item.tile.sandStone.default'/465, l='MpServer', x=232.13, y=60.00, z=-125.84], EntityItem['item.tile.sand.default'/466, l='MpServer', x=231.13, y=62.00, z=-126.13], EntityItem['item.tile.sand.default'/467, l='MpServer', x=231.12, y=63.00, z=-125.47], EntityItem['item.tile.sandStone.default'/468, l='MpServer', x=234.88, y=62.00, z=-123.86], EntityItem['item.tile.sandStone.default'/469, l='MpServer', x=234.88, y=61.00, z=-122.22], EntityItem['item.tile.sandStone.default'/470, l='MpServer', x=233.86, y=62.00, z=-123.88], EntityItem['item.tile.sandStone.default'/471, l='MpServer', x=229.95, y=62.00, z=-122.17], EntityItem['item.tile.sand.default'/472, l='MpServer', x=230.13, y=68.00, z=-127.70], EntityItem['item.tile.sand.default'/473, l='MpServer', x=228.88, y=68.00, z=-127.13], EntityItem['item.tile.sand.default'/474, l='MpServer', x=228.19, y=69.00, z=-126.81], EntitySkeleton['Skeleton'/475, l='MpServer', x=259.89, y=12.00, z=-145.50], EntitySkeleton['Skeleton'/476, l='MpServer', x=259.21, y=40.00, z=-138.50], EntitySkeleton['Skeleton'/477, l='MpServer', x=260.49, y=38.00, z=-149.70], EntityBat['Bat'/478, l='MpServer', x=259.75, y=41.10, z=-145.25], EntityBat['Bat'/479, l='MpServer', x=255.13, y=11.19, z=-133.10], EntitySkeleton['Skeleton'/480, l='MpServer', x=253.77, y=37.00, z=-140.49], EntityCreeper['Creeper'/481, l='MpServer', x=254.84, y=38.00, z=-134.46], EntityItem['item.tile.sand.default'/482, l='MpServer', x=240.50, y=68.00, z=-134.13], EntityItem['item.tile.sand.default'/483, l='MpServer', x=241.96, y=68.00, z=-135.13], EntityVillager['Villager'/484, l='MpServer', x=272.58, y=63.00, z=-184.46], EntityBat['Bat'/485, l='MpServer', x=289.75, y=30.10, z=-196.36], EntitySkeleton['Skeleton'/486, l='MpServer', x=253.78, y=13.00, z=-148.49], EntitySkeleton['Skeleton'/487, l='MpServer', x=250.45, y=27.00, z=-158.25], EntitySkeleton['Skeleton'/488, l='MpServer', x=249.70, y=27.00, z=-157.04], EntityPlayerSP['Player472'/250, l='MpServer', x=231.74, y=75.11, z=-136.82], EntityZombie['Zombie'/490, l='MpServer', x=242.50, y=25.00, z=-152.50], EntityCreeper['Creeper'/491, l='MpServer', x=248.96, y=27.00, z=-156.30], EntityCreeper['Creeper'/492, l='MpServer', x=246.15, y=36.00, z=-151.57], EntityBat['Bat'/493, l='MpServer', x=251.83, y=37.10, z=-157.25], EntityCreeper['Creeper'/494, l='MpServer', x=254.50, y=37.00, z=-150.50], EntityBat['Bat'/495, l='MpServer', x=250.75, y=35.10, z=-155.25], EntityItem['item.tile.sand.default'/496, l='MpServer', x=247.18, y=62.00, z=-158.13], EntityItem['item.tile.sand.default'/497, l='MpServer', x=248.88, y=62.00, z=-158.13], EntityItem['item.tile.sand.default'/498, l='MpServer', x=242.42, y=65.00, z=-156.14], EntityItem['item.tile.sand.default'/499, l='MpServer', x=240.66, y=65.00, z=-158.15], EntityItem['item.tile.sand.default'/500, l='MpServer', x=241.25, y=65.00, z=-155.51], EntityItem['item.tile.sand.default'/501, l='MpServer', x=241.80, y=65.00, z=-157.98], EntityItem['item.tile.sand.default'/504, l='MpServer', x=248.21, y=61.00, z=-162.88], EntityItem['item.tile.sand.default'/505, l='MpServer', x=246.13, y=62.00, z=-161.10], EntityItem['item.tile.sand.default'/506, l='MpServer', x=249.88, y=61.00, z=-160.93], EntityItem['item.tile.sand.default'/251, l='MpServer', x=228.57, y=68.00, z=-129.40], EntityCreeper['Creeper'/507, l='MpServer', x=285.22, y=31.00, z=-198.51], EntityItem['item.tile.sand.default'/252, l='MpServer', x=231.49, y=68.00, z=-130.13], EntityCreeper['Creeper'/508, l='MpServer', x=280.50, y=24.00, z=-204.50], EntityItem['item.tile.sand.default'/253, l='MpServer', x=230.13, y=68.00, z=-130.88], EntitySpider['Spider'/509, l='MpServer', x=280.99, y=31.00, z=-198.96], EntityItem['item.tile.sand.default'/254, l='MpServer', x=227.13, y=69.00, z=-128.33], EntitySkeleton['Skeleton'/510, l='MpServer', x=269.50, y=53.00, z=-189.50], EntityItem['item.item.stick'/255, l='MpServer', x=234.15, y=69.00, z=-131.18], EntityVillager['Villager'/511, l='MpServer', x=268.82, y=64.00, z=-184.35]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2886)
	at net.minecraft.client.Minecraft.run(Minecraft.java:462)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Linux (amd64) version 4.8.0-59-generic
	Java Version: 1.8.0_131, Oracle Corporation
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 252088168 bytes (240 MB) / 602406912 bytes (574 MB) up to 917504000 bytes (875 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
	FML: MCP 9.42 Powered by Forge 14.23.4.2705 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State     | ID        | Version      | Source                           | Signature |
	|:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
	| UCHIJAAAA | minecraft | 1.12.2       | minecraft.jar                    | None      |
	| UCHIJAAAA | mcp       | 9.42         | minecraft.jar                    | None      |
	| UCHIJAAAA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | forge     | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | grenadier | 0.3          | bin                              | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'VMware, Inc.' Version: '3.0 Mesa 12.0.6' Renderer: 'Gallium 0.4 on SVGA3D; build: RELEASE;  LLVM;'
	Launched Version: 1.12.2
	LWJGL: 2.9.4
	OpenGL: Gallium 0.4 on SVGA3D; build: RELEASE;  LLVM; GL version 3.0 Mesa 12.0.6, VMware, Inc.
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 4x Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
[18:13:55] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# /home/philip/git/mc12/forge-1.12.2-14.23.4.2705-mdk/./crash-reports/crash-2018-09-14_18.13.55-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

THanks all in advance.

/P

 

Edited by PhilipChonacky
Link to comment
Share on other sites

1 hour ago, PhilipChonacky said:

Here's the crash error:

When you register your renderer you are passed a RenderManager as a parameter so use it.

 

Also dont register things in preInit there are events for registration now. You can read about them on the forge docs.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

10 minutes ago, Animefan8888 said:

When you register your renderer you are passed a RenderManager as a parameter so use it.

 

Also dont register things in preInit there are events for registration now. You can read about them on the forge docs.

Hi Animefan8888,

Thanks, that was a newbie mistake!  When I looked again, I obviously overlooked it.

I've read and implemented the Event Registration, but seen both methods used by a variety of modders.

Is ForgeRegistries getting deprecated soon?  It may not be the most efficient method, but I'm working with kids and the events method gets complicated.

Link to comment
Share on other sites

1 hour ago, PhilipChonacky said:

Is ForgeRegistries getting deprecated soon?  It may not be the most efficient method, but I'm working with kids and the events method gets complicated.

It's an improper way of doing things, and it was never the proper way if doing it. The forge devs are hoping to, by using the registry events allow mod loading and unloading during runtime.

 

1 hour ago, PhilipChonacky said:

but seen both methods used by a variety of modders.

Define a variety of modders? YouTube tutorials are not really the best because they dont always do it properly.

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

13 hours ago, Animefan8888 said:

It's an improper way of doing things, and it was never the proper way if doing it. The forge devs are hoping to, by using the registry events allow mod loading and unloading during runtime.

 

Define a variety of modders? YouTube tutorials are not really the best because they dont always do it properly.

Grey Ghost is the only one I could site.  Others would have been responses on forums.

I think its a given that one can not always ascertain the knowledge of someone giving advice, and opinions abound.

 

I was actually more interested in hearing what advantages the Event Registry method has, and whether ForgeRegistries would get deprecated in the near future.

 

THanks

/P

Link to comment
Share on other sites

Where are you getting this

16 minutes ago, PhilipChonacky said:

ForgeRegistries would get deprecated in the near future

idea from? If anything non-forge registries registration methods will be deprecated. Using registry events and registries is the propper way to do things, it won't be deprecated.

 

16 minutes ago, PhilipChonacky said:

what advantages the Event Registry method has

  • It is a coherent place for things to be registered. Forge itself is event-based and it only makes sense that the registration would be too.
  • It is convenient. It is a specific place for you to register your stuff. No guessing "is this loaded yet or no", no more "what order do I register things in". Registry events solve all those issues.
  • It is the most lazy way. Instead of first declaring your things somewhere, then instantinating them and then registering them you do all of it in one place - the registry event. You create and register your things right there and then.
  • In theory it allows hot-swapping mods on the fly. Since with registry events forge can make "snapshots" of the registry it now knows what was added to the registry, when, from where and what mod is responsible. If forge ever implements "hot-swapping" it would then be trivial to remove/add things from/to the registries during runtime rather than initial startup.
  • It is the correct way of doing so. When you want to say handle an entity dying you don't write a coremod. You use an event. Same here - you should use the event because it's the right thing to do.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.