Jump to content

Raycoms

Members
  • Posts

    383
  • Joined

  • Last visited

Everything posted by Raycoms

  1. Decided to change the whole code and check it with the blockState directly.
  2. I'm storing some information in blocks and I'm making a certain amount of comparisons and I don't want to change the whole code to check for items.
  3. Yeah but I have the Stack and I need the block and not the other way around =/. Do I really have to do something like "getDisplayName().contains("oak") .... ?
  4. I have an ItemStack and I executed Block.getBlockFromItem(block). But in same cases like bed and door it doesn't work, how can I fix this?
  5. Yes I want both and I just found out that I'm sending some additional info in the message string sometimes. That's why it doesn't translate some messages on the server. Will take care of that. Thanks for the help.
  6. new TextComponentTranslation(message).getFormattedText(); I have to use the above to get the formatedString on the client? For a GUI for example? I will test something today, it's possible that something happens with the message string and it doesn't arrive correctly outside of intellij.
  7. It seems to work great in Intellij, But on the server it doesn't seem to work at all, strangely.
  8. So we will have to send a message to the client and ask for the translation for each translation we want to do?
  9. /** * Send a message to the player. * @param player the player to send to. * @param message the message to send. */ public static void sendPlayerMessage(@NotNull final EntityPlayer player, final String message) { player.sendMessage(new TextComponentTranslation(message)); } We're using this to translate our strings. It seems to work 100% inside intellij in smp and ssp. But when I produce the jar it stops working. In and ssp it just shows the english strings and in smp it does only show the placeholder strings.
  10. Could you try it with a slightly bigger size dieSieben07? Like 300 blocks down to bedrock and similar?
  11. hmm that's so strange. PacketBuffer buffer = new PacketBuffer(buf); int i = buffer.readerIndex(); byte b0 = buffer.readByte(); if(b0 != 0) { buffer.readerIndex(i); try (ByteBufInputStream stream = new ByteBufInputStream(buffer) { nbttagcompound = CompressedStreamTools.read(stream, NBTSizeTracker.INFINITE); } catch (RuntimeException e) { Log.getLogger().info("Structure too big to be processed", e); } catch (IOException e) { Log.getLogger().info("Problem at retrieving structure on server.", e); } } currentMillis = buf.readLong(); It still crashes with the same log as always and I assigned 6gb, but I scanned also a huge amount of blocks. Like 10-20 chunks down to bedrock.
  12. How can I assign more RAM to intellij to minecraft to test if the problem is that he runs out of main memory to store the scan?
  13. how about spawning them in: public boolean attackEntityFrom(@NotNull final DamageSource damageSource, final float damage)
  14. I gave it some hard testing. Is it possible that it's corrupting the bytes on the way? I set some condition break points but it never crashes for the same reason. Sometimes it's nullpointer sometimes it's missing tag. I believe it's corrupting the bytes in the transfer. Did you execute it exactly like it was on github?
  15. Noticed I was rotating it twice, once on setup once on placement. Solved
  16. I did some testing and found out that it's not working only in x or only in z. It only works in 1 rotation and that's 180° the other two are off.
  17. I'm currently running in some problems rotating structures (From the minecraft templates). The structure rotates perfectly but I can't get the entities (like itemframes) to rotate correctly. The ones facing Z-directions turn out correctly, the x directions rotate double then necessary. The method to rotate it I call with this. I already use the Template function to calculate the Vec3D transformation. Tried it with the standard BlockPos transformation as well. Didn't change anything. Template.EntityInfo newInfo = structure.transformEntityInfoWithSettings(info, world, Structure.transformedVec3d(settings, info.pos), settings); My method to rotate it. It gets the position inside the structure. The entityInfo and the placementSettings with the rotation. public Template.EntityInfo transformEntityInfoWithSettings(final Template.EntityInfo entityInfo, final World world, final Vec3d pos, final PlacementSettings settings) { final Entity finalEntity = EntityList.createEntityFromNBT(entityInfo.entityData, world); final Vec3d entityVec = pos; if (finalEntity != null) { finalEntity.prevRotationYaw = (float) (finalEntity.getMirroredYaw(settings.getMirror()) - NINETY_DEGREE); //Don't remove that line. Seems like it is doing nothing but it changes behavior! final double rotation = (double) finalEntity.getMirroredYaw(settings.getMirror()) + ((double) finalEntity.rotationYaw - finalEntity.getRotatedYaw(settings.getRotation())); finalEntity.setLocationAndAngles(entityVec.xCoord, entityVec.yCoord, entityVec.zCoord, finalEntity.getRotatedYaw(settings.getRotation()), finalEntity.rotationPitch); NBTTagCompound nbttagcompound = new NBTTagCompound(); finalEntity.writeToNBTOptional(nbttagcompound); return new Template.EntityInfo(pos, new BlockPos(pos), nbttagcompound); } return null; } Strangely I can't remove the line: final double rotation = (double) finalEntity.getMirroredYaw(settings.getMirror()) + ((double) finalEntity.rotationYaw - finalEntity.getRotatedYaw(settings.getRotation())); because when I remove it, it messes it up completely and not even z direction works anymore. /** * Transform a Vec3d with placement settings. * * @param settings the settings. * @param vec the vector. * @return the new vector. */ public static Vec3d transformedVec3d(final PlacementSettings settings, final Vec3d vec) { final Mirror mirrorIn = settings.getMirror(); final Rotation rotationIn = settings.getRotation(); double xCoord = vec.xCoord; final double yCoord = vec.yCoord; double zCoord = vec.zCoord; boolean flag = true; switch (mirrorIn) { case LEFT_RIGHT: zCoord = 1.0D - zCoord; break; case FRONT_BACK: xCoord = 1.0D - xCoord; break; default: flag = false; } switch (rotationIn) { case COUNTERCLOCKWISE_90: return new Vec3d(zCoord, yCoord, 1.0D - xCoord); case CLOCKWISE_90: return new Vec3d(1.0D - zCoord, yCoord, xCoord); case CLOCKWISE_180: return new Vec3d(1.0D - xCoord, yCoord, 1.0D - zCoord); default: return flag ? new Vec3d(xCoord, yCoord, zCoord) : vec; } }
  18. I'm currently trying to find a way to check if a certain entity (like itemFrame, armorStand) are already at a certain location. Something like getEntityAtLocation(BlockPos). Is there a way?
  19. I know that, but the itemStack has metaData and itemDamage. And I want to know if I'm able to construct an IBlockstate with the help of that
  20. I have an ItemStack with item and damage value and I need the IBlockState of it. Is there a way?
  21. Sorry not nullPointer, it's missing tag: [22:26:52] [Netty Local Client IO #1/INFO] [minecolonies]: Structure too big to be processed java.lang.RuntimeException: Missing type on ListTag at net.minecraft.nbt.NBTTagList.read(NBTTagList.java:56) ~[NBTTagList.class:?] at net.minecraft.nbt.NBTTagCompound.readNBT(NBTTagCompound.java:578) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.read(NBTTagCompound.java:52) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagList.read(NBTTagList.java:66) ~[NBTTagList.class:?] at net.minecraft.nbt.NBTTagCompound.readNBT(NBTTagCompound.java:578) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.read(NBTTagCompound.java:52) ~[NBTTagCompound.class:?] at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:147) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.read(CompressedStreamTools.java:102) ~[CompressedStreamTools.class:?] at com.minecolonies.coremod.network.messages.SaveScanMessage.fromBytes(SaveScanMessage.java:59) [saveScanMessage.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) [simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) [simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:103) [FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:40) [FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) [MessageToMessageCodec$2.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) [MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:413) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:278) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
  22. Hmm, I strangely get still the same error with the nullpointer. @Override public void fromBytes(@NotNull final ByteBuf buf) { PacketBuffer buffer = new PacketBuffer(buf); int i = buffer.readerIndex(); byte b0 = buffer.readByte(); if(b0 != 0) { buffer.readerIndex(i); try (ByteBufInputStream stream = new ByteBufInputStream(buffer) { nbttagcompound = CompressedStreamTools.read(stream, NBTSizeTracker.INFINITE); } catch (RuntimeException e) { Log.getLogger().info("Structure too big to be processed", e); } catch (IOException e) { Log.getLogger().info("Problem at retrieving structure on server.", e); } } storeLocation = ByteBufUtils.readUTF8String(buf); } with and without the packetBuffer stuff and with the storelocation over or under the block. It only works if I remove the storeLocation completely. (Like previously)
  23. Thanks a lot I will try it out directly!
  24. Use the scan tool item at two very distant points. (obtainable in creative tab on page two)
×
×
  • Create New...

Important Information

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