
Paladin
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by Paladin
-
So I'm trying to render some textures for this one mob I've created, however I can't seem to get it to render the appropriate based off the gender of the mob. public ResourceLocation getSkin() { if(!this.world.isRemote){ if(this.isFemale){ return HUMAN_TEXTURES_FEMALE; }else{ if(this.prof == prof.soldier){ return HUMAN_TEXTURES; }else{ return HUMAN_TEXTURES; } } }else{ return new ResourceLocation("minecraft:textures/entity/steve.png"); } } Right now the only texture that renders in-game is the steve texture, and when I remove if(!this.world.isRemote){ The textures won't render on the correct type of mob... For example a female texture rendering on a male-only soldier mob. Is there any way to resolve this? Additional Code :
-
Sorry for the duplicate my internet lagged. Please respond to the other topic I've made.
-
Hello, I'm current Attempting to implement 2 new mob types, one of which I'm planning to have mounted on a horse, and the other a ranged attacker.. Archer Villager public class EntityVillagerArcher extends EntityVillagerSoldier implements IRangedAttackMob{ Horse Mounted Villager: public class EntityVillagerCaptain extends EntityVillagerSoldier{ Completed Melee Villager: public class EntityVillagerSoldier extends EntityVillager{ On the topic of the horse mounted Villager I've attempted to copy some code from the spider class replacing the spider references with a new horse, but all it does is freeze my EntityVillagerCaptain once it's spawned. EntityHorse horse = new EntityHorse(this.world); horse.setPosition(this.posX, this.posY, this.posZ); this.world.spawnEntity(horse); this.startRiding(horse); Some Notes: The EntityVillagerCaptain jerks his arms and legs around rapidly. The horse is nowhere to be seen. And upon some debugging, the message: [16:42:28] [Client thread/WARN]: Received passengers for unknown entity IS also displayed in the console each to a EntityVillagerCaptain is spawned. Is there something I'm doing wrong, or is there a better way to do this? On the topic of the Archer Villager My main problem is that the EntityAIAttackRangedBow requires the class to be an instance of the Abstract Skeleton Class . However I can't make my Archers extend this class as my villager soldiers will start attacking them. EntityAIAttackRangedBow(AbstractSkeleton skeleton, double speedAmplifier, int delay, float maxDistance) Should I just make my own custom AI? or is there a workaround to my current problem with Villager Archer? Thanks.
-
Hello, I'm current Attempting to implement 1 new mob type, which I'm planning to have mounted on a horse. Horse Mounted Villager: public class EntityVillagerCaptain extends EntityVillagerSoldier{ Completed Melee Villager: public class EntityVillagerSoldier extends EntityVillager{ I've attempted to copy some code from the spider class replacing the spider references with a new horse, but all it does is freeze my EntityVillagerCaptain once it's spawned. EntityHorse horse = new EntityHorse(this.world); horse.setPosition(this.posX, this.posY, this.posZ); this.world.spawnEntity(horse); this.startRiding(horse); Some Notes: The EntityVillagerCaptain jerks his arms and legs around rapidly. The horse is nowhere to be seen. And upon some debugging, the message: [16:42:28] [Client thread/WARN]: Received passengers for unknown entity IS also displayed in the console each to a EntityVillagerCaptain is spawned. Is there something I'm doing wrong, or is there a better way to do this? Thanks.
-
Hello, I was having some trouble with editing the blocks that spawn when a vanilla structure is generated. Is there a way I can do this without making my own custom class file based off of that Structure? Method I'm attempting to change: protected IBlockState getBiomeSpecificBlockState(IBlockState blockstateIn) { net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID event = new net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, blockstateIn); net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getReplacement(); if (this.structureType == 1) { if (blockstateIn.getBlock() == Blocks.LOG || blockstateIn.getBlock() == Blocks.LOG2) { return Blocks.SANDSTONE.getDefaultState(); } if (blockstateIn.getBlock() == Blocks.COBBLESTONE) { return Blocks.SANDSTONE.getStateFromMeta(BlockSandStone.EnumType.DEFAULT.getMetadata()); } if (blockstateIn.getBlock() == Blocks.PLANKS) { return Blocks.SANDSTONE.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()); } if (blockstateIn.getBlock() == Blocks.OAK_STAIRS) { return Blocks.SANDSTONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, blockstateIn.getValue(BlockStairs.FACING)); } if (blockstateIn.getBlock() == Blocks.STONE_STAIRS) { return Blocks.SANDSTONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, blockstateIn.getValue(BlockStairs.FACING)); } if (blockstateIn.getBlock() == Blocks.GRAVEL) { return Blocks.SANDSTONE.getDefaultState(); } } else if (this.structureType == 3) { if (blockstateIn.getBlock() == Blocks.LOG || blockstateIn.getBlock() == Blocks.LOG2) { return Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLog.LOG_AXIS, blockstateIn.getValue(BlockLog.LOG_AXIS)); } if (blockstateIn.getBlock() == Blocks.PLANKS) { return Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.SPRUCE); } if (blockstateIn.getBlock() == Blocks.OAK_STAIRS) { return Blocks.SPRUCE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, blockstateIn.getValue(BlockStairs.FACING)); } if (blockstateIn.getBlock() == Blocks.OAK_FENCE) { return Blocks.SPRUCE_FENCE.getDefaultState(); } } else if (this.structureType == 2) { if (blockstateIn.getBlock() == Blocks.LOG || blockstateIn.getBlock() == Blocks.LOG2) { return Blocks.LOG2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(BlockLog.LOG_AXIS, blockstateIn.getValue(BlockLog.LOG_AXIS)); } if (blockstateIn.getBlock() == Blocks.PLANKS) { return Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.ACACIA); } if (blockstateIn.getBlock() == Blocks.OAK_STAIRS) { return Blocks.ACACIA_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, blockstateIn.getValue(BlockStairs.FACING)); } if (blockstateIn.getBlock() == Blocks.COBBLESTONE) { return Blocks.LOG2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Y); } if (blockstateIn.getBlock() == Blocks.OAK_FENCE) { return Blocks.ACACIA_FENCE.getDefaultState(); } } return blockstateIn; } Villages spawn in the Ice Plains Biome in my mod, and I'd like some biome-specific blocks to generate on the structures that spawn. Referenced in the StructureVillagePieces.class: IBlockState iblockstate1 = this.getBiomeSpecificBlockState(Blocks.OAK_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.NORTH)); IBlockState iblockstate2 = this.getBiomeSpecificBlockState(Blocks.OAK_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.WEST)); IBlockState iblockstate3 = this.getBiomeSpecificBlockState(Blocks.PLANKS.getDefaultState()); this.setBlockState(worldIn, iblockstate3, 3, 3, 1, structureBoundingBoxIn); Thanks for any help.
-
Thanks for the response, but the problem is that I want to edit that private value so that it allows villages to spawn closer together when vanilla minecraft generates them... I don't need to reference the value in my own mod's code. But if I need an instance, I might as well create my own custom MapGenVillage.class. I wasn't planning on doing this simply because I thought that'll be a lot of effort when I could just to change one private variable in vanilla minecraft's code to solve my problem .
-
Hello, I'm creating a mod in which I'd like to adjust a value of one private variables in the Minecraft's original MapGenVillage.class. The variables I'm trying to change: I made an attempts using the Reflection Helper to access and modify these values but: Doesn't solve the problem at all (I think it throws a NullPointerException). Is there a way I can change the value without an instance of the class?