• Posts

    • I’ll give that a shot after I get off. Thanks so much!
    • So I would have ServerScriptItem and ClientScriptItem, both inheriting from ScriptItem, and I would register a ServerScriptItem object on the dedicated server and a ClientScriptItem object on the client?
    • https://mcforge.readthedocs.io/en/1.13.x/networking/
    • Welcome to Minearchy! A 1.14.4 Towny Community   Details Server: Paper 1.14.4 Difficulty: Hard Whitelist: off Game mode: Towny Land claiming/protection: on What is Towny?Towny is an extensive land claiming plugin designed for servers. Towny promotes teamwork and comradery through the creation of towns. You and all your friends can team up and start a town, claim land, and grow into a powerful nation. Every day, towns are required to pay an upkeep fee. If you fail to pay the fee, your town will fall to ruins. Jobs and player run shops are the only source of income. In order to keep your town thriving, players need to work their jobs and sell items to other neighboring towns. As your town grows and takes in more citizens, you might consider creating a nation with another town. As a nation, you can wage war against other nations. However, if you're not into player versus player combat, and all that, you might consider the peaceful life of running a neutral town. No matter if you like brutal combat or tending to your fields, towny is for you.Features Towny Jobs mcMMO Boss Fights Tiered Mobs A balanced, player run economy Custom Enchantments Custom Curses Community Challenges 25 Rankups Weekly events & tournaments Absolutely no pay to win Cosmetics Want to see more on this list? Join our discord https://discord.gg/vUEAanV and we’d be more than happy to consider your suggestions! RulesNo one likes rules, so I’ll keep this short, simple, and straight to the point. Please keep in mind that staff members have the right to interpret and act upon these rules as they deem fit. Use common sense. If you don’t think you should do something, don’t do it. Respect the other players. This should go under common sense… No hacking or modding your client for an unfair advantage. Swearing is allowed in moderation. Discuss / post appropriate topics and materials. Griefing in claimed territories is not allowed. If a town/nation falls to ruins, looting is allowed. If you have questions about any of the rules, please ask a staff member for clarification. They’d be more than happy to help you out.Links IP: play.minearchy.net Discord: https://discord.gg/vUEAanV Reddit: https://www.reddit.com/r/Minearchy/ (Work in progress) Wiki: https://www.reddit.com/r/Minearchy/wiki/index (Work in progress) Store: http://store.minearchy.net (Work in progress) Bug Log: https://trello.com/b/MrMTeJvV/minearchy-issues Release DateMinearchy is planning on releasing mid-December. In the meantime, stay posted on our discord server and check out all our sneak peeks!Thanks for ReadingThanks for stopping by and checking out Minearchy. Hopefully you find this post intriguing. We would greatly appreciate it if you stopped by our discord server and checked us out! (https://discord.gg/vUEAanV)
    • Hi   My item has ItemHandler capability, which works fine. But one of the things I have when storing a item on the capability is overring the translation key with the contained stack's translation key.     The problem is that this will only sync when opening the item again. I need to send a message to the client with the new contained stack which I do not know how to do. I don't know which ItemStack I need to change on the client when the container is closed.     My item needs to have two capabilities attached to it. One is the Forge ItemHandler Capability while the other that is exclusive to the glass variant should be able to store a liquid too. For this, I made a provider that includes these capabilities: public class StackFluidContainerProvider implements ICapabilitySerializable { private final FluidContainer fluid; private final ItemStackHandler inventory; private final LazyOptional<IItemHandler> itemHandler = LazyOptional.of(this::getInventory); private final LazyOptional<IFluidContainer> fluidHandler = LazyOptional.of(this::getFluid); public StackFluidContainerProvider(short slots, short maxVolume) { inventory = new ItemStackHandler(slots); fluid = new FluidContainer(maxVolume); } protected FluidContainer getFluid() { return fluid; } protected ItemStackHandler getInventory() { return inventory; } @SuppressWarnings("ConstantConditions") @Override public INBT serializeNBT() { CompoundNBT compoundNBT = new CompoundNBT(); compoundNBT.put("items", CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.getStorage().writeNBT(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,getInventory(),null)); compoundNBT.put("fluid", FluidContainerStorage.FLUID_CONTAINER_CAPABILITY.getStorage().writeNBT(FluidContainerStorage.FLUID_CONTAINER_CAPABILITY,getFluid(),null)); return compoundNBT; } @Override public void deserializeNBT(INBT nbt) { if (nbt instanceof CompoundNBT) { CompoundNBT compoundNBT = (CompoundNBT)nbt; CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.getStorage().readNBT(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, getInventory(), null, compoundNBT.get("items")); FluidContainerStorage.FLUID_CONTAINER_CAPABILITY.getStorage().readNBT(FluidContainerStorage.FLUID_CONTAINER_CAPABILITY, getFluid(), null, compoundNBT.get("fluid")); } } @SuppressWarnings("unchecked") public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return itemHandler.cast(); else if (cap == FluidContainerStorage.FLUID_CONTAINER_CAPABILITY) return fluidHandler.cast(); return (LazyOptional<T>) LazyOptional.empty(); } }   But when I try and fetch the capability the parameter cap seems to always be null, which means it always returns the first statement (in this case the ItemHandler) which results in a casting error.
  • Topics

  • Who's Online (See full list)