Jump to content

RobinCirex

Members
  • Posts

    115
  • Joined

  • Last visited

Everything posted by RobinCirex

  1. Hey, I'm trying to render 2D rects in 3D for my mod. Does somebody have an idea how to make that? I attached an example
  2. Hey, I want to make it so players can't take items out of a chest. How can I do this?
  3. well, my mod has a special condition for users. I want to save whether they are in this condition or not
  4. Hey guys, how do I get the directory of a world when playing singleplayer? (.minecraft/saves/worldname/)
  5. It is, as the ice and fire mod is for 1.12. But that doesn't change anything, right?
  6. Yes, those plugins are installed. I haven't added the dependencies in the build.gradle because it says " // you may put jars on which you depend on in ./libs"
  7. Hey, I don't know if this is the correct place to ask, but I'm gonna try anyway. Someone asked me to make a mod which makes it so that specific mods of the mod Ice and Fire can't grief the environment in worldguarded regions. For that, I have to use a spigot plugin as a dependency in a forge mod. When I built the mod using gradlew build and started the server, it can't use the libraries and throws a ClassNotFoundException where I use the worldguard things (which makes sense). Does someone know how I could do this? I added the plugins (worldguard and worldedit) to the ./libs folder too
  8. hm, okay, thank you anyway
  9. well, that's what I meant with blocks moving smoothly. I'm sorry, anyway, do you know how I'm going to do this?
  10. Well, basically I want to make ships moving like in this video. I don't want a block by block movement though (4
  11. Well then, apparently a TileEntity isn't the right tool either.
  12. Well, the second parameter of the Builder is blocks that the tileentity can be applied to. But I want the TE to be applied to any block
  13. Ah okay, makes sense. What do I put in if I want it to be for all blocks
  14. So far, I'm having problems with what arguments I put in for Builder.create and for new EntityBlockRenderer package me.cirex.fluidships.registry; import me.cirex.fluidships.FluidShips; import me.cirex.fluidships.block.InvisibleBlock; import me.cirex.fluidships.entity.EntityBlock; import me.cirex.fluidships.entity.renderer.EntityBlockRenderer; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class ShipRegistry { public static TileEntityType<?> BLOCK_TILE_ENTITY; @SubscribeEvent public void onBlockRegistry(final RegistryEvent.Register<Block> event) { } @SubscribeEvent public void onEntityTypeRegistry(final RegistryEvent.Register<TileEntityType<?>> event) { BLOCK_TILE_ENTITY = TileEntityType.Builder.create(null, null).build(null); event.getRegistry().register(BLOCK_TILE_ENTITY); } public void registerRenderer() { RenderingRegistry.registerEntityRenderingHandler(BLOCK_TILE_ENTITY, new EntityBlockRenderer()); } public void onClientSetup(final FMLClientSetupEvent event) { registerRenderer(); } } package me.cirex.fluidships.registry; import me.cirex.fluidships.FluidShips; import me.cirex.fluidships.block.InvisibleBlock; import me.cirex.fluidships.entity.EntityBlock; import me.cirex.fluidships.entity.renderer.EntityBlockRenderer; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class ShipRegistry { public static TileEntityType<?> BLOCK_TILE_ENTITY; @SubscribeEvent public void onBlockRegistry(final RegistryEvent.Register<Block> event) { } @SubscribeEvent public void onEntityTypeRegistry(final RegistryEvent.Register<TileEntityType<?>> event) { BLOCK_TILE_ENTITY = TileEntityType.Builder.create(null, null).build(null); event.getRegistry().register(BLOCK_TILE_ENTITY); } public void registerRenderer() { RenderingRegistry.registerEntityRenderingHandler(BLOCK_TILE_ENTITY, new EntityBlockRenderer()); } public void onClientSetup(final FMLClientSetupEvent event) { registerRenderer(); } }
  15. I can't really get it working using a TileEntity. Can you maybe answer my original question?
  16. well, okay, thank you
  17. Hey, I'm trying to make blocks that are moving smoothly. For that, I want to create an entity that renders the block. I'm registering the renderer but for some reason, it isn't being rendered. This is my code of the renderer and the registry package me.cirex.fluidships.entity.renderer; import com.mojang.blaze3d.matrix.MatrixStack; import me.cirex.fluidships.entity.EntityBlock; import me.cirex.fluidships.entity.model.EntityBlockModel; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.registry.IRenderFactory; public class EntityBlockRenderer extends EntityRenderer<EntityBlock> { protected EntityBlockRenderer(EntityRendererManager renderManager) { super(renderManager); } @Override public void render(EntityBlock entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn) { System.out.println("test"); EntityBlockModel model = new EntityBlockModel(entityIn); for (net.minecraft.client.renderer.RenderType type : net.minecraft.client.renderer.RenderType .getBlockRenderTypes()) { model.render(matrixStackIn, bufferIn.getBuffer(type), packedLightIn, 0, 1, 1, 1, 1); } super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn); } @Override public ResourceLocation getEntityTexture(EntityBlock entity) { return null; } public static class RenderFactory implements IRenderFactory<EntityBlock> { @Override public EntityRenderer<? super EntityBlock> createRenderFor(EntityRendererManager manager) { return new EntityBlockRenderer(manager); } } } package me.cirex.fluidships.registry; import me.cirex.fluidships.FluidShips; import me.cirex.fluidships.block.InvisibleBlock; import me.cirex.fluidships.entity.EntityBlock; import me.cirex.fluidships.entity.renderer.EntityBlockRenderer; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class ShipRegistry { @SuppressWarnings("unchecked") public static EntityType<EntityBlock> BLOCK_ENTITY = (EntityType<EntityBlock>) EntityType.Builder .create(EntityBlock::new, EntityClassification.MISC).size(1F, 1F) .build(FluidShips.MODID + ":block_entity") .setRegistryName(new ResourceLocation(FluidShips.MODID, "block_entity")); public static Block INVISIBLE_BLOCK = new InvisibleBlock(); @SubscribeEvent public void onBlockRegistry(final RegistryEvent.Register<Block> event) { event.getRegistry().register(INVISIBLE_BLOCK); } @SubscribeEvent public void onEntityTypeRegistry(final RegistryEvent.Register<EntityType<? extends Entity>> event) { event.getRegistry().register(BLOCK_ENTITY); } public void registerRenderer() { RenderingRegistry.registerEntityRenderingHandler(BLOCK_ENTITY, new EntityBlockRenderer.RenderFactory()); } public void onClientSetup(final FMLClientSetupEvent event) { registerRenderer(); } }
  18. Hey, I'm trying to make smoothly moving blocks. For that, I need a BlockRendererDispatcher to render the block. The BlockRendererDispatcher has two parameters in its constructer. It needs a "BlockModelShape" and "BlockColors". Can someone tell me how to get those?
  19. Yes, this mod is for 1.12 as it's an addon for pixelmon and that only exists for 1.12
  20. well, there isn't much to show. This is the networkwrapper being initiated @EventHandler public void preInit(FMLPreInitializationEvent event) { networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel("settlementchannel"); networkWrapper.registerMessage(Message.ClientHandler.class, Message.class, 0, Side.CLIENT); networkWrapper.registerMessage(TaxMessage.ClientHandler.class, TaxMessage.class, 1, Side.CLIENT); networkWrapper.registerMessage(ArmyMessage.ClientHandler.class, ArmyMessage.class, 2, Side.CLIENT); networkWrapper.registerMessage(UserMessage.ClientHandler.class, UserMessage.class, 3, Side.CLIENT); Nothing happens in the PlayerLoggedOutEvent except this @SubscribeEvent public void onLeave(PlayerLoggedOutEvent event) { User user = SettlementMod.getInstance().getUserManager().getUser(event.player); if (user != null) { user.player = null; } } which is just looping through an arraylist and has nothing to do with networking there is also no "constant connection" the server only sends information to the client on a specific event
  21. Hey I'm making a mod that has a connection between the server and the client using a SimpleNetworkWrapper When a player disconnects, the server throws this exception java.io.IOException: Eine bestehende Verbindung wurde softwaregesteuert durch den Hostcomputer abgebrochen at sun.nio.ch.SocketDispatcher.write0(Native Method) ~[?:1.8.0_211] at sun.nio.ch.SocketDispatcher.write(Unknown Source) ~[?:1.8.0_211] at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source) ~[?:1.8.0_211] at sun.nio.ch.IOUtil.write(Unknown Source) ~[?:1.8.0_211] at sun.nio.ch.SocketChannelImpl.write(Unknown Source) ~[?:1.8.0_211] at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:417) ~[NioSocketChannel.class:4.1.9.Final] at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856) ~[AbstractChannel$AbstractUnsafe.class:4.1.9.Final] at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362) ~[AbstractNioChannel$AbstractNioUnsafe.class:4.1.9.Final] at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823) ~[AbstractChannel$AbstractUnsafe.class:4.1.9.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296) ~[DefaultChannelPipeline$HeadContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.ChannelDuplexHandler.flush(ChannelDuplexHandler.java:117) ~[ChannelDuplexHandler.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115) ~[ChannelOutboundHandlerAdapter.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115) ~[ChannelOutboundHandlerAdapter.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115) ~[ChannelOutboundHandlerAdapter.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.flush(NetworkDispatcher.java:558) ~[NetworkDispatcher.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[AbstractChannelHandlerContext.class:4.1.9.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[DefaultChannelPipeline.class:4.1.9.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[AbstractChannel.class:4.1.9.Final] at net.minecraft.network.NetworkManager$4.run(NetworkManager.java:261) [NetworkManager$4.class:?] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [AbstractEventExecutor.class:4.1.9.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) [SingleThreadEventExecutor.class:4.1.9.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [NioEventLoop.class:4.1.9.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [SingleThreadEventExecutor$5.class:4.1.9.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] The german part basically means that the Hostcomputer closed the connection through the software. It doesn't really have any side effects, it still bothers me and wanted to ask how to fix this error
  22. This doesn‘t answer my question. Basically I have a mod and if it gets specific packets its supposed to render specific models. So I want to make custom packets that the mod is listening to
  23. Well, basically I'm trying to build up a connection between spigot and forge. I don't want to manipulate the packets or anything, just listen to them. I didn't figure it out yet, would be nice if you helped me
  24. Oh yea, I had it in the ClientSetupEvent, I changed it for some reason. I'll try that out, will get back if I still need help
×
×
  • Create New...

Important Information

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