Jump to content

[1.10.2] 1 more fluid problem


MCrafterzz

Recommended Posts

1. How to make a empty bucket pick up the custom fluid without using forges universial bucket. Bucket:http://pastebin.com/q1ffU7La

You need to subscribe to

FillBucketEvent

like

UniversalBucket

does.

 

Why not just use the universal bucket, though?

 

 

3. How to make the fluid destroy portal blocks:

Fluid block: http://pastebin.com/HRAx8qcP

 

In your constructor, add

Blocks.PORTAL

to the

BlockFluidBase#displacements

map.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

2.

public BlockEnderium() {

super(FluidEnderium.instance, MaterialEnderium.enderium);

displacements.put(Blocks.PORTAL, false);

displacements.put(Blocks.END_PORTAL, false);

}

 

Doesn't work nor does:

public BlockEnderium() {

super(FluidEnderium.instance, MaterialEnderium.enderium);

displacements.put(Blocks.PORTAL,true);

displacements.put(Blocks.END_PORTAL, true);

}

Link to comment
Share on other sites

1. this doesn't work:

@SubscribeEvent(priority = EventPriority.LOW)

public void onFillBucket(FillBucketEvent event) {

if (event.getResult() != Event.Result.DEFAULT) {

// event was already handled

return;

}

 

// not for us to handle

ItemStack emptyBucket = event.getEmptyBucket();

if (emptyBucket == null) {

return;

}

 

// needs to target a block

RayTraceResult target = event.getTarget();

if (target == null || target.typeOfHit != RayTraceResult.Type.BLOCK) {

return;

}

 

World world = event.getWorld();

BlockPos pos = target.getBlockPos();

 

ItemStack singleBucket = emptyBucket.copy();

singleBucket.stackSize = 1;

event.setResult(Event.Result.ALLOW);

event.setFilledBucket(new ItemStack(this));

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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