Jump to content

[1.10.2] Looking for an adjacent block.


gmod622

Recommended Posts

okay this is firing everytick, how would I put make it so it only updates when placed / when the TE is placed next to it, and have it reset if it is destroyed.

Use

neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)

and

getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack)

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

Okay, so I get a crash:

 

[21:12:40] [server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: net.minecraft.util.ReportedException: Exception while updating neighbours
at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_101]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_101]
at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:742) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
Caused by: net.minecraft.util.ReportedException: Exception while updating neighbours
at net.minecraft.world.World.notifyBlockOfStateChange(World.java:605) ~[World.class:?]
at net.minecraft.world.World.notifyNeighborsOfStateChange(World.java:531) ~[World.class:?]
at net.minecraft.world.World.notifyNeighborsRespectDebug(World.java:482) ~[World.class:?]
at net.minecraft.world.World.markAndNotifyBlock(World.java:421) ~[World.class:?]
at net.minecraft.world.World.setBlockState(World.java:402) ~[World.class:?]
at net.minecraft.block.Block.removedByPlayer(Block.java:1324) ~[block.class:?]
at net.minecraft.server.management.PlayerInteractionManager.removeBlock(PlayerInteractionManager.java:298) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.removeBlock(PlayerInteractionManager.java:292) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.tryHarvestBlock(PlayerInteractionManager.java:339) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.onBlockClicked(PlayerInteractionManager.java:175) ~[PlayerInteractionManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:658) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:56) ~[CPacketPlayerDigging.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:12) ~[CPacketPlayerDigging.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_101]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_101]
at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]
... 5 more
Caused by: java.lang.NullPointerException
at com.lambda.PlentifulMisc.blocks.tile.TileEntitySolarGenerator.updateFromNeighbor(TileEntitySolarGenerator.java:34) ~[TileEntitySolarGenerator.class:?]
at com.lambda.PlentifulMisc.blocks.BlockSolarGenerator.neighborChanged(BlockSolarGenerator.java:35) ~[blockSolarGenerator.class:?]
at net.minecraft.block.state.BlockStateContainer$StateImplementation.neighborChanged(BlockStateContainer.java:480) ~[blockStateContainer$StateImplementation.class:?]
at net.minecraft.world.World.notifyBlockOfStateChange(World.java:584) ~[World.class:?]
at net.minecraft.world.World.notifyNeighborsOfStateChange(World.java:531) ~[World.class:?]
at net.minecraft.world.World.notifyNeighborsRespectDebug(World.java:482) ~[World.class:?]
at net.minecraft.world.World.markAndNotifyBlock(World.java:421) ~[World.class:?]
at net.minecraft.world.World.setBlockState(World.java:402) ~[World.class:?]
at net.minecraft.block.Block.removedByPlayer(Block.java:1324) ~[block.class:?]
at net.minecraft.server.management.PlayerInteractionManager.removeBlock(PlayerInteractionManager.java:298) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.removeBlock(PlayerInteractionManager.java:292) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.tryHarvestBlock(PlayerInteractionManager.java:339) ~[PlayerInteractionManager.class:?]
at net.minecraft.server.management.PlayerInteractionManager.onBlockClicked(PlayerInteractionManager.java:175) ~[PlayerInteractionManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:658) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:56) ~[CPacketPlayerDigging.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:12) ~[CPacketPlayerDigging.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_101]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_101]
at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]
... 5 more
0
0
0
0
0

 

everytime I update it / place it.

 

Also how would I tell if the TE is destroyed and minus connectedTile.

 

here is the block class & te:

package com.lambda.PlentifulMisc.blocks;

import com.lambda.PlentifulMisc.Reference;
import com.lambda.PlentifulMisc.blocks.tile.TileEntitySolarGenerator;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockSolarGenerator extends Block implements ITileEntityProvider{

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

public BlockSolarGenerator() {
	super(Material.ROCK);
	setUnlocalizedName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getUnlocalizedName());
	setRegistryName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getRegistryName());
	setHardness(2);
}

@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
	return new TileEntitySolarGenerator();
}

@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
	tileEntitySolarGenerator.updateFromNeighbor();
}

@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) {
	tileEntitySolarGenerator.updateFromPlaced();

	return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, stack);
}

//small upgrades, size of torches, act like torches.
}

 

package com.lambda.PlentifulMisc.blocks.tile;

import com.lambda.PlentifulMisc.init.ModBlocks;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class TileEntitySolarGenerator extends TileEntity implements ITickable{

public int energyOutput;
public int connectedTiles;
public boolean canSendEnergy;

@Override
public void update() {

	System.out.println(connectedTiles);

	if(worldObj.isDaytime()) {
		canSendEnergy = true;
	} else {
		canSendEnergy = false;
	}
}

public void updateFromNeighbor() {
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos pos = getPos().offset(face);
	     if (getWorld().getTileEntity(pos) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}

}

public void updateFromPlaced() {
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos pos = getPos().offset(face);
	     if (getWorld().getTileEntity(pos) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
}

}




Not new to java >> New to modding.

Link to comment
Share on other sites

First off this is not going to work in your block class

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

instead use world.getTileEntity(pos)

 

Next pass in a World and BlockPos variable into updateFromPlaced() and updateFromNeighbor()

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

But the methods are Block methods, not TE.

Both methods neighborChanged and getStateForPlacement have a world and a BlockPos parameter.

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

So then :

package com.lambda.PlentifulMisc.blocks.tile;

import com.lambda.PlentifulMisc.init.ModBlocks;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class TileEntitySolarGenerator extends TileEntity implements ITickable{

public int energyOutput;
public int connectedTiles;
public boolean canSendEnergy;

@Override
public void update() {

	System.out.println(connectedTiles);

	if(worldObj.isDaytime()) {
		canSendEnergy = true;
	} else {
		canSendEnergy = false;
	}
}

public void updateFromNeighbor() {


}

public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posN = getPos().offset(face);
	     if (getWorld().getTileEntity(posN) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
}
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) {		
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posState = getPos().offset(face);
	     if (getWorld().getTileEntity(posState) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
	return null;

} 


}




Not new to java >> New to modding.

Link to comment
Share on other sites

So then :

package com.lambda.PlentifulMisc.blocks.tile;

import com.lambda.PlentifulMisc.init.ModBlocks;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class TileEntitySolarGenerator extends TileEntity implements ITickable{

public int energyOutput;
public int connectedTiles;
public boolean canSendEnergy;

@Override
public void update() {

	System.out.println(connectedTiles);

	if(worldObj.isDaytime()) {
		canSendEnergy = true;
	} else {
		canSendEnergy = false;
	}
}

public void updateFromNeighbor() {


}

public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posN = getPos().offset(face);
	     if (getWorld().getTileEntity(posN) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
}
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) {		
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posState = getPos().offset(face);
	     if (getWorld().getTileEntity(posState) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
	return null;

} 


}




You only need the World and BlockPos ones,and what does your Block file look like now?

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

here is the updated te:

package com.lambda.PlentifulMisc.blocks.tile;

import com.lambda.PlentifulMisc.init.ModBlocks;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class TileEntitySolarGenerator extends TileEntity implements ITickable{

public int energyOutput;
public int connectedTiles;
public boolean canSendEnergy;

@Override
public void update() {

	System.out.println(connectedTiles);

	if(worldObj.isDaytime()) {
		canSendEnergy = true;
	} else {
		canSendEnergy = false;
	}
}


public void neighborChanged(World worldIn, BlockPos pos) {
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posN = getPos().offset(face);
	     if (getWorld().getTileEntity(posN) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
}
public IBlockState getStateForPlacement(World world, BlockPos pos) {		
	for (EnumFacing face : EnumFacing.values()) {
	     BlockPos posS = getPos().offset(face);
	     if (getWorld().getTileEntity(posS) instanceof TileEnityCrystallizer) {
	    	 	connectedTiles += 1;
	     } else {

	     }

	}
	return null;

} 


}




 

and block

package com.lambda.PlentifulMisc.blocks;

import com.lambda.PlentifulMisc.Reference;
import com.lambda.PlentifulMisc.blocks.tile.TileEntitySolarGenerator;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockSolarGenerator extends Block implements ITileEntityProvider{

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

public BlockSolarGenerator() {
	super(Material.ROCK);
	setUnlocalizedName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getUnlocalizedName());
	setRegistryName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getRegistryName());
	setHardness(2);
}

@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
	return new TileEntitySolarGenerator();
}

//small upgrades, size of torches, act like torches.
}

Not new to java >> New to modding.

Link to comment
Share on other sites

First don't implement ITileEntityProvider instead override hasTileEntity(IBlockState) and createTileEntity(World, IBlockState)

 

Then you removed the methods neighborChanged()and getStateForPlacement()

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

So just this in the block class:

public class BlockSolarGenerator extends Block {

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

public BlockSolarGenerator() {
	super(Material.ROCK);
	setUnlocalizedName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getUnlocalizedName());
	setRegistryName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getRegistryName());
	setHardness(2);
}


@Override
public boolean hasTileEntity() {
	return true;
}

@Override
public TileEntity createTileEntity(World world, IBlockState state) {
	return new TileEnityCrystallizer();
}

//small upgrades, size of torches, act like torches.
}

 

te just staying the same

Not new to java >> New to modding.

Link to comment
Share on other sites

That is not the correct hasTileEntity() method.  You want hasTileEntity(IBlockState state).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

So this:

 

public class BlockSolarGenerator extends Block {

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

public BlockSolarGenerator() {
	super(Material.ROCK);
	setUnlocalizedName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getUnlocalizedName());
	setRegistryName(Reference.PlentifulMiscBlocks.SOLARGENERATOR.getRegistryName());
	setHardness(2);
}


@Override
public boolean hasTileEntity(IBlockState state) {
 return true;
}

@Override
public TileEntity createTileEntity(World world, IBlockState state) {
	return new TileEnityCrystallizer();
}

@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
	tileEntitySolarGenerator.neighborChanged(worldIn, pos);
}

@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,float hitZ, int meta, EntityLivingBase placer, ItemStack stack) {
	tileEntitySolarGenerator.getStateForPlacement(world, pos);
	return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, stack);
}

//small upgrades, size of torches, act like torches.
}

 

Also, what should I be returning on getStateForPlacement in the te & block

Not new to java >> New to modding.

Link to comment
Share on other sites

You can't do this.

TileEntitySolarGenerator tileEntitySolarGenerator = new TileEntitySolarGenerator();

tileEntitySolarGenerator.neighborChanged(worldIn, pos)

You need to do worldIn.getTileEntity(pos) to get the Tile Entity.

 

And you would just use the super.getStateForPlacement(...)

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

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am not using hardcoded recipes, I'm using Vanilla's already existing code for leather armor dying. (via extending and implementing DyeableArmorItem / DyeableLeatherItem respectively) I have actually figured out that it's something to do with registering item colors to the ItemColors instance, but I'm trying to figure out where exactly in my mod's code I would be placing a call to the required event handler. Unfortunately the tutorial is criminally undescriptive. The most I've found is that it has to be done during client initialization. I'm currently trying to do the necessary setup via hijacking the item registry since trying to modify the item classes directly (via using SubscribeEvent in the item's constructor didn't work. Class so far: // mrrp mrow - mcmod item painter v1.0 - catzrule ch package catzadvitems.init; import net.minecraft.client.color.item.ItemColors; import net.minecraft.world.item.Item; import net.minecraftforge.registries.ObjectHolder; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.client.event.ColorHandlerEvent; import catzadvitems.item.DyeableWoolArmorItem; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class Painter { @ObjectHolder("cai:dyeable_wool_chestplate") public static final Item W_CHEST = null; @ObjectHolder("cai:dyeable_wool_leggings") public static final Item W_LEGS = null; @ObjectHolder("cai:dyeable_wool_boots") public static final Item W_SOCKS = null; public Painter() { // left blank, idk if forge throws a fit if constructors are missing, not taking the chance of it happening. } @SubscribeEvent public static void init(FMLClientSetupEvent event) { new Painter(); } @Mod.EventBusSubscriber private static class ForgeBusEvents { @SubscribeEvent public static void registerItemColors(ColorHandlerEvent.Item event) { ItemColors col = event.getItemColors(); col.register(DyeableUnderArmorItem::getItemDyedColor, W_CHEST, W_LEGS, W_SOCKS); //placeholder for other dye-able items here later.. } } } (for those wondering, i couldn't think of a creative wool helmet name)
    • nvm found out it was because i had create h and not f
    • Maybe there's something happening in the 'leather armor + dye' recipe itself that would be updating the held item texture?
    • @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre e) { e.setCanceled(true); model.renderToBuffer(e.getPoseStack(), pBuffer, e.getPackedLight(), 0f, 0f, 0f, 0f, 0f); //ToaPlayerRenderer.render(); } Since getting the render method from a separate class is proving to be bit of a brick wall for me (but seems to be the solution in older versions of minecraft/forge) I've decided to try and pursue using the renderToBuffer method directly from the model itself. I've tried this route before but can't figure out what variables to feed it for the vertexConsumer and still can't seem to figure it out; if this is even a path to pursue.  The vanilla model files do not include any form of render methods, and seem to be fully constructed from their layer definitions? Their renderer files seem to take their layers which are used by the render method in the vanilla MobRenderer class. But for modded entities we @Override this function and don't have to feed the method variables because of that? I assume that the render method in the extended renderer takes the layer definitions from the renderer classes which take those from the model files. Or maybe instead of trying to use a render method I should be calling the super from the renderer like   new ToaPlayerRenderer(context, false); Except I'm not sure what I would provide for context? There's a context method in the vanilla EntityRendererProvider class which doesn't look especially helpful. I've been trying something like <e.getEntity(), model<e.getEntity()>> since that generally seems to be what is provided to the renderers for context, but I don't know if it's THE context I'm looking for? Especially since the method being called doesn't want to take this or variations of this.   In short; I feel like I'm super super close but I have to be missing something obvious? Maybe this insane inane ramble post will provide some insight into this puzzle?
  • Topics

×
×
  • Create New...

Important Information

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