Giter Site home page Giter Site logo

Comments (5)

jredfox avatar jredfox commented on July 29, 2024

pickblock event is client only and sends the stack directly to server side.

from bluerpg.

Bluexin avatar Bluexin commented on July 29, 2024

Yeah I know, problem is because we don't send unidentified item data to clients (to prevent hax), the data doesn't get cloned either.

from bluerpg.

jredfox avatar jredfox commented on July 29, 2024

I made pickblock event on server side only client can't hack the server's code and converted it to forge events found here and here:
https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/evilnotch/lib/asm/transformer/GeneralTransformer.java#L28
https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/evilnotch/lib/main/eventhandler/PickBlock.java

However don't do what I did or our mods would remain. Is there a way multple overrides of pickblock event could exist?

I did this so silkspawners could properly fetch spawnpotentials while middle clicking a spawner block

from bluerpg.

Bluexin avatar Bluexin commented on July 29, 2024

Thanks.
The server is already notified of the player using "pick block" in a gui though, so I'd rather hook into that directly, see

object SlotTypeUsable : SlotType() {
override fun handleClick(
slot: SlotBase,
container: ContainerBase,
dragType: Int,
clickType: ClickType?,
player: EntityPlayer
): Pair<Boolean, ItemStack> =
if (!player.world.isRemote && slot.stack.isNotEmpty && !player.isCreative && clickType == ClickType.CLONE) {
val r = (player as EntityPlayerMP).interactionManager.processItemUse(
player,
player.world,
slot.stack,
EnumHand.MAIN_HAND
)
if (r == EnumActionResult.PASS) super.handleClick(slot, container, dragType, clickType, player)
else true to slot.stack
} else super.handleClick(slot, container, dragType, clickType, player)

from bluerpg.

Bluexin avatar Bluexin commented on July 29, 2024

But anyway, this is low priority compared to some other stuff on the roadmap.

from bluerpg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.