Jump to content

deerangle

Members
  • Posts

    259
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by deerangle

  1. That worked Excellently. Thank you!
  2. So if i understand it correctly, you removed the "Advanced Combat" mod, and it still doesn't work? If so, can you show the new message you get on your screen?
  3. I am currently working on generating a dungeon in my mod. It contains some TileEntities which contents I want to randomize (MOB_SPAWNER, CHEST, and custom). For the MOB_SPAWNER I tried the following: TileEntity te = worldIn.getTileEntity(bd.getPos()); if(te == null){ te = new TileEntityMobSpawner(); } NBTTagCompound nbt = new NBTTagCompound(); NBTTagCompound spawn = new NBTTagCompound(); te.writeToNBT(nbt); spawn.setString("id", "minecraft:zombie"); nbt.setTag("SpawnData", spawn); te.readFromNBT(nbt); worldIn.setTileEntity(bd.getPos(), te); When I run this code, absolutely nothing appears to happen. The spawner looks the same and the spawner spawns Pigs. Now my concrete question is: How would I properly change TileEntitiy values when doing WorldGeneration?
  4. What update frequency do living entities use? they seem to fall correctly.
  5. I made an entity which should fall from the sky. It falls, but the hitbox seems to lag behind the actual entity. And when the hitbox is out of the View Frustum it doesn't render, thus creating a bug which I must remove. Registering the entity: ENTITY_COMET = EntityEntryBuilder.create().entity(EntityComet.class).id(InterstellarComets.MODID + ":" + "comet", 0).name("comet").tracker(64, 20, true).build(); Entity's onUpdate code: @Override public void onUpdate() { super.onUpdate(); this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; if (this.posY <= 68) { //that it doesn't fall out of the map this.posY = 68; }else{ this.motionY -= getGravityVelocity(); } } protected float getGravityVelocity() { return 0.03F; }
  6. Thanks! It's working now!
  7. https://github.com/deerangle2/InterstellarComets/tree/master/main/java/com/deerangle/
  8. Use this: GL11.glTranslated(0.5, 0.5, 0.5); GL11.glRotated(270, 1, 0, 0); GL11.glTranslated(-0.5, -0.5, -0.5); you were translating incorrectly! PS: Don't forget to rotate back after rendering!
  9. Exactly what are you trying to achieve? Do you only want the Server console to be able to send the command, or do you want the command to be executed server-side-only?
  10. OK. I'm now using Constructor Reference and deleted the RenderFactory. Also, I Am calling RenderingRegistry.registerEntityRenderingHandler(EntityComet.class, RenderComet::new); via the ClientProxy in preInit, after registering the entity. the Render's Constructor is being called, but doRender is not being called. My Entity also initializes, so it must exist.
  11. I just checked again, and although my ClientProxy.preinit() is begin called, it appears, that RenderCometFactory.createRenderFor() isn't being called!
  12. I registered my IRenderFactory: Do you seperately need to register the renderer itself?
  13. I created a basic entity (I am going to make behavior once I get it to render). And I checked that Entity.onUpdate() and Entity.onEntityUpdate() are being called. I register my IRenderFactory in my ClientProxy (is also being called): RenderingRegistry.registerEntityRenderingHandler(EntityComet.class, new RenderCometFactory()); Here, my RenderFactory: public class RenderCometFactory implements IRenderFactory<EntityComet> { @Override public Render<? super EntityComet> createRenderFor(RenderManager manager) { return new RenderComet(manager); } } I register the Entity in my ModEntityRegistry class: private EntityEntry ENTITY_COMET = new EntityEntry(EntityComet.class, "comet").setRegistryName("comet"); /** * ... **/ @SubscribeEvent public void registerEntity(RegistryEvent.Register<EntityEntry> event){ IForgeRegistry<EntityEntry> registry = event.getRegistry(); registry.register(ENTITY_COMET); } This is my EntityRender class: public class RenderComet extends Render<EntityComet> { protected RenderComet(RenderManager renderManager) { super(renderManager); } @Override public void doRender(EntityComet entity, double x, double y, double z, float entityYaw, float partialTicks) { super.doRender(entity, x, y, z, entityYaw, partialTicks); System.out.println("Am i rendering?"); } @Override public RenderManager getRenderManager() { return super.getRenderManager(); } @Override protected ResourceLocation getEntityTexture(EntityComet entity) { return null; } } And the entity class... public EntityComet(World worldIn, int x, int y, int z) { this(worldIn); this.setPosition(x, y, z); } public EntityComet(World worldIn) { super(worldIn); this.setSize(1, 1); } @Override public void onEntityUpdate() { super.onEntityUpdate(); } @Override public void onUpdate() { super.onUpdate(); System.out.println(getPosition()); } @Override protected void entityInit() { System.out.println("wüoghjweg"); } @Override protected void readEntityFromNBT(NBTTagCompound compound) { // TODO Auto-generated method stub } @Override protected void writeEntityToNBT(NBTTagCompound compound) { // TODO Auto-generated method stub } All methods seem to be getting called (except for render, of course).
  14. In the scoreboard, chatcolors are used. Check out the code used to display chat messages. It contains the code, that uses color codes to render text
  15. I managed to solve my problem with exactly this. Thank you for the tips, @diesieben07
  16. double d6 = (double)(blockpattern$patternhelper.getFrontTopLeft().getY() + 1) - entityIn.getLastPortalVec().y * (double)blockpattern$patternhelper.getHeight(); this is the line of code in the Teleporter class, that crashes the game. since the blockpattern$patternhelper object is created 3 lines above, it must be either entityIn or entityIn.getLastPortalVec(). I assume it is actually entityIn.getLastPortalVec(). The variable returned by this function is only set in the Entity#setPortal(BlockPos pos).
  17. private void onFoodEaten(int meta, ItemStack stack, World worldIn, EntityPlayer player) { if (!worldIn.isRemote) { player.changeDimension(-1); } }
  18. look at net.minecraft.world.gen.structure.StructureVillagePieces
  19. In my mod, I made an item which can teleport you into the nether. But when I use it, I get a NullPointerException with following stack trace: java.lang.NullPointerException: Ticking player at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:136) at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:36) at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:748) at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:655) at net.minecraft.server.management.PlayerList.changePlayerDimension(PlayerList.java:642) at net.minecraft.entity.player.EntityPlayerMP.changeDimension(EntityPlayerMP.java:745) at com.deerangle.item.ItemChocolateBar.onFoodEaten(ItemChocolateBar.java:197) at com.deerangle.item.ItemChocolateBar.onItemUseFinish(ItemChocolateBar.java:117) at net.minecraft.item.ItemStack.onItemUseFinish(ItemStack.java:242) at net.minecraft.entity.EntityLivingBase.onItemUseFinish(EntityLivingBase.java:3062) at net.minecraft.entity.player.EntityPlayerMP.onItemUseFinish(EntityPlayerMP.java:1227) at net.minecraft.entity.EntityLivingBase.updateActiveHand(EntityLivingBase.java:2956) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2311) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:272) at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423) at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185) at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:196) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:863) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) at java.lang.Thread.run(Unknown Source) Solution: instead of player.changeDimension(-1); use player.setPortal(player.getPosition()); player.changeDimension(-1);
  20. Figured it out! I was using wrong NBT data . But i was initially calling it server side too. Thanks!
  21. Are you trying to say, that this cast is redundant? Or what should i do?
  22. I now tried ((WorldClient) worldIn).makeFireworks(player.posX, player.posY, player.posZ, 0, 0, 0, tag); That still doesn't work.
  23. I am trying to make a firework explosion, but nothing is happening with world.makeFireworks(), because it is empty now, and it worked in 1.7.10. How can i do the same thing now?
×
×
  • Create New...

Important Information

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