Jump to content

Dr_Schnauzer

Members
  • Posts

    15
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Dr_Schnauzer's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thats right and what I meant with: . But I thought diesieben07 suggested, adding the @Deprecated Annotation to the overridden methods.
  2. This may works in Eclipse, but IntelliJ still shows a warning and I am just too lazy to search for the settings right now ...
  3. Well, ok ... time to suppress @Deprecated annotations in the Block classes then ... Thanks for the quick response!
  4. Since a huge amount of methods in the Block class are now marked as @Deprecated, I was poking around and searched for the replacement. The replacement seems to be the methods in the IBlockState (which is currently just passing it to the block). I tested a custom implementation for a BlockStateContainer that creates a IBlockState with my own implementaion. It works, but would be annoying if you have to create a new IBlockState implementation for every block. So my question is: will this custom implementation be needed in the future, or is there an other way that I just haven't found yet?
  5. I fixed it. I didn't realize the IItemColor class itself was clientside only and used it on both sides. *facepalm* The only thing that is left is the broken Log Connection between the Intellij Idea console and the Minecraft Server. But that is not a gamebreaker.
  6. I recently updated my Mod from 1.8.9 to 1.9. In 1.8 everything worked fine (Server and Client). After the port the Client works perfectly, but when I start the Server I always get this crash: net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: de/dr_schnauzer/ac/core/items/HotIngot at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:179) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:559) at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:93) at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:320) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:119) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoClassDefFoundError: de/dr_schnauzer/ac/core/items/HotIngot at de.dr_schnauzer.ac.AlchemyCraft.preInit(AlchemyCraft.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556) ... 5 more Caused by: java.lang.ClassNotFoundException: de.dr_schnauzer.ac.core.items.HotIngot at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 33 more Caused by: java.lang.NoClassDefFoundError: de/dr_schnauzer/ac/core/items/ACIngotRaw at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 35 more Caused by: java.lang.ClassNotFoundException: de.dr_schnauzer.ac.core.items.ACIngotRaw at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 39 more I double checked everything and the classes are definitely present at the Client and the Server. The only difference in the 1.8 and 1.9 Versions is the implementation of the IItemColor Interface. Maybe someone out here can help me out here. Also (not quite the Topic, but also related to the Server) when starting the Server in Intelij Idea, the Log doesn't work. The only Log printed is this: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker ERROR Error processing element TerminalConsole: CLASS_NOT_FOUND ERROR Error processing element TerminalConsole: CLASS_NOT_FOUND WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream ERROR Unable to locate appender Console for logger com.mojang ERROR Unable to locate appender FmlConsole for logger ERROR Unable to locate appender Console for logger net.minecraft WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream ERROR Error processing element TerminalConsole: CLASS_NOT_FOUND ERROR Error processing element TerminalConsole: CLASS_NOT_FOUND WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream ERROR Unable to locate appender Console for logger com.mojang ERROR Unable to locate appender FmlConsole for logger ERROR Unable to locate appender Console for logger net.minecraft
  7. I got a Block with two models. When one of these Blocks is connected to an other one it should change the state to blocked, else unblocked. Sounds simple. Here is the working code for changing the state when the Block is placed and the actual state handling: @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { for(EnumFacing facing : EnumFacing.HORIZONTALS){ if(world.getBlockState(pos.offset(facing)).getBlock() == this){ //Block found -> block TEForgeDistributor distributor = (TEForgeDistributor)world.getTileEntity(pos); if(!distributor.isBlocked()) { distributor.setState(true); distributor.markDirty(); world.markBlockForUpdate(pos); return; } } } //no block found -> unblock TEForgeDistributor distributor = (TEForgeDistributor)world.getTileEntity(pos); if(distributor.isBlocked()) { distributor.setState(false); distributor.markDirty(); world.markBlockForUpdate(pos); } } @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TEForgeDistributor){ TEForgeDistributor distributor = (TEForgeDistributor)world.getTileEntity(pos); return state.withProperty(BlockStateProperties.BLOCKED, distributor.isBlocked()); } return state; } So far everything is working good and instant. But when I use the neighbor Block Change method, the state changes also instant, but the Client only updates the model when an other block in a close range produces a update. Neighbor Block Change Method: @Override public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock) { for(EnumFacing facing : EnumFacing.HORIZONTALS){ if(world.getBlockState(pos.offset(facing)).getBlock() == this){ TEForgeDistributor distributor = (TEForgeDistributor)world.getTileEntity(pos); distributor.setState(true); distributor.markDirty(); world.markBlockForUpdate(pos); return; } } TEForgeDistributor distributor = (TEForgeDistributor)world.getTileEntity(pos); distributor.setState(false); distributor.markDirty(); world.markBlockForUpdate(pos); } I'm running out of Ideas, is something missing or is this a bug. When I Output the state on both sides it has the correct state. Only the model is not updating.
  8. Ok, so I have to go with a TileEntity then, thanks for the reply !
  9. I'm just curious, is it actually possible to modify the ExtendedBlockState after it is created? I've tried to do the following: In The Block Class: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if(state instanceof IExtendedBlockState){ System.out.println(((IExtendedBlockState)state).getValue(BlockStateProperties.unlistedBlockPos); } return true; } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if(state instanceof IExtendedBlockState){ state = ((IExtendedBlockState)state).withProperty(BlockStateProperties.unlistedBlockPos, pos); } worldIn.setBlockState(pos, state, 3); } @Override public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) { if(state instanceof IExtendedBlockState){ return ((IExtendedBlockState)state).withProperty(BlockStateProperties.unlistedBlockPos, pos); } return state; } @Override protected BlockState createBlockState() { return new ExtendedBlockState(this, new IProperty[]{BlockStateProperties.FACING}, new IUnlistedProperty[]{BlockStateProperties.unlistedBlockPos}); } When I call worldIn.setBlockState(pos, state, 3) and the state is a ExtendedBlockState the Block will be placed and removed just right after. But even if I don't set it and just try to access the value, it allways return null. The unliestedBlockPos is just a unlisted Property that will Keep a BlockPos: public static final IUnlistedProperty<BlockPos> unlistedBlockPos = new IUnlistedProperty<BlockPos>() { @Override public String getName() { return "unlistedBlockPos"; } @Override public boolean isValid(BlockPos value) { return true; } @Override public Class<BlockPos> getType() { return BlockPos.class; } @Override public String valueToString(BlockPos value) { return value.toLong()+""; } }; Is it actually no way to access the ExtendedBlockState, or is something missing?
  10. I'm stucked now for a while, cause I don't know how I have to use the ISpecialArmor getProperties() to let the armor work like it has a armor material, that defines the damage reduction. I've tried this, but it doesn't seem to work when I compare it to normal armor. @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { if(armor.getTagCompound() != null) { ArmorValues values = ArmorValues.readFromNBT(armor); return new ArmorProperties(0, values.getResistance() / 25.0D, values.getResistance()); } return new ArmorProperties(0, 0, 0); } The problem why I can't use a armor material is, that the armor is different in the damage reduction depending on the crafting.
  11. When I was working on my mod, I had a question about the performance of the Item rendering in 1.8. What provides a better performance for Minecraft, one model and one texture, that is colored by the client, or a separate texture and a separate Model for each item.
  12. OK, I've tried to use TextureAtlasSprite sprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(material)).getTexture(); int[][] textureRBG = sprite.getFrameTextureData(sprite.getFrameCount); But I always get a Array out of Bound Exception at Index 0, Size: 0 when calling getFrameTextureData(). The Texture is correct because sprite.getIconName() returns the correct Texture ...
  13. Is there a method to get the Texture from a Item and get the Color code from a Pixel in that Texture ? Because I'd like for example to paint a Texture for a Item, that is made out of Gold, in the same Color as the Gold Ingot. I've already tried to do it with the RenderManager, but this doesn't help me ...
  14. I've already played a little with the json files and Minecraft normally require a separate json file for each item. Is there a way to use only a single json file for multiple items? Because that would help me a lot with my Mod. (I'm not lazy! But my Mod creates Items based on the ability to create a Armor out of these Materials)
×
×
  • Create New...

Important Information

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