Jump to content

TheCrafter4000

Forge Modder
  • Posts

    33
  • Joined

  • Last visited

Converted

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TheCrafter4000's Achievements

Tree Puncher

Tree Puncher (2/8)

3

Reputation

  1. Where do you call your IGuiHandler#getServerSideElements / IGuiHandler#getClientSideElements ? Has IDs.storableItemGui the same value at both sides ?
  2. Have watched the tutorial, but I don't want to add or remove some gui - elements if I click the tab, I want to change the container behind, on client and server side
  3. Hello, I wanted to create a gui with tabs( like the creative inventory ). I looked into the creative inventory code, but it looks like the container is the same for every tab ( with other item's of course ), but I need different ( like http://technicpack.wikia.com/wiki/Thermal_Expansion_GUI or gui's in ThinkersConstruct ). Any ideas?
  4. I think I fixed it! I copied the 1.8.9.json(https://github.com/MinecraftForge/MinecraftForge/blob/755df95c96e698cc12cdb51b2d5e4e4f1d1be467/jsons/1.8.9.json) and put it in the dev.json. Working by me, maybe by you too.
  5. I'm using the KeyTypedEvent to get notifyed if the inventory is opened( event is called on cilent side only ), than i'm opening the gui( GuiContainer ), but the container ( Container ) is not opened.
  6. I'm working on a extended player inventory. It's working fine, but the container on server side is not loaded because it's not called, so i need to send a packet from cilent( code is fired at cilent side ) to server.
  7. Hello guys, i need a way to "convert" a EntityPlayerSP( Cilent ) to EntityPlayerMP( Server ).
  8. Fixed it, it looks like I haven't overrided the navigator of my villager, canNavigate() was never true. Why can't I use the normal navigator?
  9. Sorry, my mistake. I play in a flat - world and has a y-offset of 5, I use a offset of four before, still not work. System.out.println( pos.up(5) );
  10. Look at this, I called it in my VillagerWorker - class, because that's the class I'm using this.tasks.addTask(2, new EntityAISaveResources(this, output)); I know that it cannot work if someone destroys the blocks the entity has to go to. I looked into EntityAIMoveToBlock, but I hadn't understood what some methodes do, for exsample the abstract methode func_179488_a(). And it looks like the destanationBlock is get randomly, but my Entity must go to a fixed position, in my case and just for debugging 0,0,0.
  11. 1. In my EntityAISaveResources class, at startExecuting() 2. Yes, 0.5D 3. Does that methode exist? 4. Yes My Villager class public abstract class Villager extends EntityCreature { protected ItemStack[] inventory = new ItemStack[10]; private WorkingState state = WorkingState.Config; public Villager(World worldIn,int GetResourcesMaximum) { super(worldIn); this.state.setMaximums( GetResourcesMaximum ); this.setSize(0.6F, 1.8F); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIOpenDoor(this, true)); this.setAIMoveSpeed(0.5f); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute( SharedMonsterAttributes.maxHealth ).setBaseValue(12); this.getEntityAttribute( SharedMonsterAttributes.movementSpeed ).setBaseValue(0.5D); this.getEntityAttribute( SharedMonsterAttributes.followRange ).setBaseValue(20D); } public ItemStack[] getVillagerInventory() { return inventory; } @Override public void onStruckByLightning(EntityLightningBolt lightningBolt) { if (!this.worldObj.isRemote) { EntityWitch entitywitch = new EntityWitch(this.worldObj); entitywitch.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); entitywitch.func_180482_a(this.worldObj.getDifficultyForLocation(new BlockPos(entitywitch)), (IEntityLivingData)null); this.worldObj.spawnEntityInWorld(entitywitch); this.setDead(); } } @Override public boolean getAlwaysRenderNameTag() { return true; } @Override protected String getLivingSound() { return "mob.villager.idle"; } @Override protected String getHurtSound() { return "mob.villager.hit"; } @Override protected String getDeathSound() { return "mob.villager.death"; } public void setReady() { if( this.state == WorkingState.Config ) WorkingState.increment(state); } public void increment() { WorkingState.increment(state); } public WorkingState getState(){ return state; } public void setSave() { this.state = WorkingState.SaveResources; } @Override public float getAIMoveSpeed() { return super.getAIMoveSpeed(); } My Villager subclass( extends Villlager ) public class VillagerWorker extends Villager { private ItemStack[] recipe = new ItemStack[9]; private BlockPos workbench; private BlockPos[] input = new BlockPos[9]; private ItemStack itemoutput; private BlockPos output; public VillagerWorker(World worldIn) { super(worldIn, ; this.setReady(); output = new BlockPos( 0, 0,0 ); this.setSave(); this.tasks.addTask(2, new EntityAISaveResources(this, output)); } } My EntityAISaveResources - class public class EntityAISaveResources extends EntityAIBase { private BlockPos pos; private Villager villager; public EntityAISaveResources(Villager villager, BlockPos pos) { this.villager = villager; this.pos = pos; this.setMutexBits(5); } @Override public boolean shouldExecute() { return villager.getState() == WorkingState.SaveResources; } @Override public void startExecuting() { System.out.println( pos.up(5) ); System.out.println( villager.getNavigator().tryMoveToXYZ(pos.getX(), pos.getY(), pos.getZ(), 0.5D) ); villager.increment(); } } WorkingState is just an Enum public enum WorkingState { GetResources,DoWork,SaveResources,Config; int GetResourcesCounter,GetResourcesMaximum; public void setMaximums( int GetResourcesMaximum ) { this.GetResourcesCounter = 0; this.GetResourcesMaximum = GetResourcesMaximum; } public static void increment( WorkingState state ){ if( state == GetResources ) { if( state.GetResourcesCounter < state.GetResourcesMaximum ) { state.GetResourcesCounter++; } else { state.GetResourcesCounter = 0; state = DoWork; } } else if( state == SaveResources ) state = GetResources; else if( state == DoWork ) state = SaveResources; else if( state == Config ) state = GetResources; } } Hope thats helpful
×
×
  • Create New...

Important Information

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