Jump to content

TheDav1311

Members
  • Posts

    73
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Dafuq?

TheDav1311's Achievements

Stone Miner

Stone Miner (3/8)

1

Reputation

  1. Thank you, that solves the problem. And the extended block storage comes from the original code (Random Block Updates in the WorldServer.class), and I didn't remove them.....
  2. I didn't find a method to get the ID out of a world Yeah, that was dump That the world dies slowly
  3. I need a more efficient way to do something like this: In a forest the ticks per second going down to ca. 6. @SubscribeEvent public void world_tick(WorldTickEvent event) { if(!event.world.isRemote) { WorldServer world = (WorldServer) event.world; if(!world.equals(DimensionManager.getWorld(SolarApocalypse.dimID))) return; int ticks = world.getGameRules().getInt("randomTickSpeed"); int day = WorldProviderSolar.getDataFor(world).day; Chunk[] array = world.getChunkProvider().getLoadedChunks().toArray(new Chunk[world.getChunkProvider().getLoadedChunkCount()]); if(array.length>1) for(int i=0; i < ticks; i++) { Chunk chunk = array[rand.nextInt(array.length)]; for (ExtendedBlockStorage extendedblockstorage : chunk.getBlockStorageArray()) { if(extendedblockstorage != Chunk.NULL_BLOCK_STORAGE && extendedblockstorage.getNeedsRandomTick()) { for (int c = 0; c< ticks; c++) { int x = rand.nextInt(16) + chunk.xPosition*16; int z = rand.nextInt(16) + chunk.zPosition*16; BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(x, 0, z)); this.change_block(world, pos, day, true); } } } } } } /* * changes block beneath the BlockPos */ private void change_block(WorldServer world, BlockPos up, int day, boolean surface) { boolean needs_clean_up = false; BlockPos down = up.down(); Block block = world.getBlockState(down).getBlock(); if(block.equals(Blocks.GRASS) || block.equals(Blocks.GRASS_PATH) || block.equals(Blocks.MYCELIUM) || block.equals(Blocks.DIRT)) { world.setBlockState(down, Blocks.DIRT.getStateFromMeta(1), 2); needs_clean_up = true; } else if(surface && block.isFlammable(world, down, EnumFacing.UP) && !world.getBlockState(up).getBlock().equals(Blocks.FIRE)) { world.setBlockState(down, Blocks.FIRE.getDefaultState(), 2); } else if(block.equals(Blocks.DIRT)) { world.setBlockState(down, Blocks.GRAVEL.getDefaultState(), 2); needs_clean_up = true; } else if(block.equals(Blocks.GRAVEL)) { world.setBlockState(down, Blocks.SAND.getDefaultState(), 2); } else if(block.equals(Blocks.SAND)) { needs_clean_up = true; this.change_block(world, down, day, false); } if(surface && needs_clean_up) { world.setBlockState(up, Blocks.AIR.getDefaultState(), 2); } }
  4. looks like you don't have a jdk.
  5. I want to save as an example an integer to the world. My problem is: I can save and load without a problem, but with a restart of the client i get a "null" public class Test { private final static String nbt = "test"; @SubscribeEvent public void test(PlayerInteractEvent.RightClickItem event) { World world = event.getWorld(); TestWorldSavedData data = new TestWorldSavedData(nbt); data.test = 10; world.getPerWorldStorage().setData(nbt, data); } @SubscribeEvent public void test(PlayerInteractEvent.RightClickEmpty event) { System.out.println(event.getWorld().getPerWorldStorage().getOrLoadData(TestWorldSavedData.class, nbt)); } public static class TestWorldSavedData extends WorldSavedData { public int test; public TestWorldSavedData(String name) { super(name); } @Override public void readFromNBT(NBTTagCompound tag) { test= tag.getInteger(nbt); } @Override public NBTTagCompound writeToNBT(NBTTagCompound tag) { tag.setInteger(nbt, test); return tag; } } }
  6. okey...? Then I will stop and restart the daylight-circle every few ticks. Or is this a bad idea?
  7. I would like to change the duration of a day in the overworld with a dynamic variable. The only thing I know is: The duration is only a fix integer in this method: WorldProvider#calculateCelestialAngle
  8. Thank you, that works fine.
  9. I want to have a player list on both sides. And here all players at the client side: Minecraft.getMinecraft().theWorld.playerEntities;
  10. 2 Things: First: I asked to get a player from a String. Second: The client must know the other players to render them, right? And there are EntityClientPlayerMPs and I want to get them.
  11. At the server side there is this Method: EntityPlayerMP playerExample = MinecraftServer.getServer().getConfigurationManager().func_152612_a("ExampleGuy"); Is there something like that at the client side?
  12. I get this Error code, but Minecraft starts and load my mod: I started a new Mod so I have not much code: Main class package de.troubleInStevesTown.main; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import de.troubleInStevesTown.block.*; import de.troubleInStevesTown.item.*; import de.troubleInStevesTown.utility.*; @Mod(modid = TST.MODID, name = TST.NAME,version = TST.VERSION) public class TST { @SidedProxy(clientSide = "de.troubleInStevesTown.main.ClientProxy", serverSide = "de.troubleInStevesTown.main.CommonProxy") public static CommonProxy proxy; public static final String MODID = "TroubleInStevesTown"; public static final String NAME = "Trouble in Steve's Town"; public static final String VERSION = "1.0"; @EventHandler public void preInit(FMLPreInitializationEvent event) { System.out.println("Hey Pre"); } @EventHandler public void init(FMLInitializationEvent event) { TSTBlocks.registerBlocks(); TSTBlocks.registerTileEntitys(); TSTItems.registerItems(); System.out.println("Hey Init"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { System.out.println("Hey Post"); } } The other classes are simply empty or have a empty method. I marked the the "@EventHandler" one time out, but same error.
  13. I'm confused. I follow exactly this steps: http://www.minecraftforge.net/wiki/Installation/Source There they say: The system variable should call PATH And if I call it JAVA_HOME: And the both path are right.
  14. PATH system variable:
  15. I don't understand how I get in this way a ResourceLocation of a specific Item
×
×
  • Create New...

Important Information

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