Code Monkey home page Code Monkey logo

dropt-1.12's Introduction

dropt-1.12's People

Contributors

codetaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dropt-1.12's Issues

Blocks without rules or matching rules don't drop XP

Hello,
I add your mod to my modpack to have total control over what the ores and blocks drop when mining. Your mod seems really very powerful and well done, but what I do not like is that as soon as it completely removes the XP drop when you mine coal, diamand or quartz for example. I would like to have a quick and easy way to reactivate the XP drop, without having to redo the drops of all blocks, if I find them correct. Of course, we must keep the possibility of override these values.

Fireztonez

Crash on gamestart (Null pointer exception)

Crash Report: https://paste.dimdev.org/nahaqehawi.mccrash
Athenaeum: 1.15.0
Dropt: 1.11.2
Forge: 14.23.5.2794

Another qestion i would like to ask if there is another way to communicate with you besides your github repos. I mean i found you on twitter and discord, but would it be okay if i pm you there?

Loving your mods. Heavily using dropt and artisan worktables in my current pack. keep up the good work!

TPS and block lag with veinminer or anything that destroys multiple blocks at once

I am having big TPS drop when mining a lot of blocks at once. I change the drops for every ore block and when I veinmine for example coal, it drops the TPS from 20 to 13 for a minute and I see some block lag. I used BlockDropsTweaker later on which wasn't causing any TPS issue. Also, I have around 10-12 drops based on chance too.

RuleDrop's listed after empty RuleDrops don't get parsed

{
  "rules": [
    {
      "debug": true,
      "match": {
        "blocks": {
          "blocks": [
            "minecraft:tallgrass:1"
          ]
        }
      },
      "drops": [
        {},
        {
          "item": {
            "items": [
              "survivalist:plant_fibres"
            ],
            "quantity": {
              "min": 1,
              "max": 3
            }
          }
        }
      ]
    }
  ]
}
[DEBUG] Parsing rule 0 in file plant_fibres.json
[DEBUG] [PARSE] Parsed block match: minecraft:tallgrass:1
[DEBUG] [PARSE] Found registered block: Block{minecraft:tallgrass}
[DEBUG] [PARSE] Added block matcher: BlockMatcher{domain='minecraft', path='tallgrass', meta=1, metas=[]}
[DEBUG] [PARSE] No item matches defined, skipped parsing item match
[DEBUG] [PARSE] Drop item.items object not defined or empty in IRuleDrop at index 0, skipped parsing drop item

There should be another entry parsed after the last line in the log.

Add IRuleMatchHarvester type for "real player" and "fake player"

Hello,

Would like to suggest a feature which I don't believe is currently in dropt. Right now the only player types supported are "any", "player", and "non_player". The issue is that many mods include automation which acts like a player, and thus still triggers under the "player" condition. Having a separate condition for "real_player" and "fake_player" to catch automation behaving as a player would make dropt a more powerful tool for pack developers.

It may help you to see how other mods accomplish this. I know that InControl and FxControl by McJty have "real player" and "fake player" conditions for their actions, here is a link to that mod's homepage and their source code.

https://minecraft.curseforge.com/projects/in-control
https://github.com/McJtyMods/InControl

Thanks for your consideration!

  • Luke

Server Side Only?

As per the title; is it possible to have this mod function when installed on only the server side?

Natural leaf decay not dropping items

Trying to add custom drops to the leaves of a tree, but the drops are only occurring when broken by hand.

Here is a pastebin of the relevant config file https://pastebin.com/TwWaVfvf

Harvester type is left blank, which should default to ANY - although I have tried adding that line and specifying ANY but the result is the same.

Using:
Minecraft 1.12.2
Forge 14.23.2.2624
Dropt 1.7.0
Athaenaeum 1.13.0

Thank you!
Luke616

[Question] Can a block can drop multiple items at once?

I want to overwright the block drop of sand to drop 4 sand piles.

I've already tried:

Dropt.list("chapter0")
    .priority(0)
    .add(Dropt.rule()
        .matchDrops([<minecraft:sand>])
        .addDrop(Dropt.drop()
            .items([<contenttweaker:pile_sand>])
            .items([<contenttweaker:pile_sand>])
            .items([<contenttweaker:pile_sand>])
            .items([<contenttweaker:pile_sand>])
        )
    )

and

Dropt.list("chapter0")
    .priority(0)
    .add(Dropt.rule()
        .matchDrops([<minecraft:sand>])
        .addDrop(Dropt.drop()
            .items([<contenttweaker:pile_sand>*4])
        )
    )

but neither of them work. What am I doing wrong?

also how is the discord server going? I'm still waiting for it :)

Bug on my modpack, the pack crash during start (Exception: java.lang.OutOfMemoryError)

Hello,
After several updates of mods, it is impossible to start the pack with your mod. As soon as I activate your mod, my modpack crash with an error;
"Exception: java.lang.OutOfMemoryError"
(I allow more than 9go of Ram now, so for sure is not realy a problem with not enough memory allow to java... The pack run great with less than that without Dropt...)

I know that it is very probably a conflict with another mod, but I can not find out what mod it is. So I send you the boot logs, possibly that you will be able to see where the problem is coming from.

Tell me if you are ever able to give me a track on the problem or if you can do some things for that. Otherwise, I will continue to try to find where the error comes from adding one mod at a time (I already spent about 3 hours to do this, without finding for the moment) ...

https://gist.github.com/Fireztonez/51f7a9065f5f777683ab75c335bed1c7

Minecraft 1.12.2
Dropt 1.12.2 - 1.8.2
Forge 14.23.2.2632
Java 1.8.0_161

NBT on blocks

having a problem getting NBT data to work for match:blocks. I'm using /dropt hand to get the string.
snippet of the code
https://pastebin.com/7iVVj4x9

I get the error [PARSE] too many segments in
["horsepower:chopping_block:0#{textureBlock:{id:"minecraft:log",Count:1b,Damage:1s}}"]

Use empty hand

Perhaps this is already possible but I am too dense to figure it out. Is there any way to force a condition to match an empty hand (in IRuleMatchHarvesterHeldItemMainHand)?

Add whitelist/blacklist functionality to more match lists

This will be a syntax breaking change.

  • rule.match.blocks
    • change to object
    • add type as enum: whitelist | blacklist
    • add blocks as array
  • rule.match.items
    • change to object
    • change object name to rule.match.drops
    • add type as enum: whitelist | blacklist
    • add drops as array
  • rule.match.harvester.heldItemMainHand
    • change to object
    • add type as enum: whitelist | blacklist
    • add items as array
  • rule.match.harvester.playerName
    • change to object
    • add type as enum: whitelist | blacklist
    • add names as array
  • rule.match.harvester.gamestages
    • change existing type to require
    • add type as enum: whitelist | blacklist

Script not replacing drops as expected.

My script,

https://pastebin.com/B8bPWLc0

Should be replacing the block biomesoplenty:log_4:5

with a weighted list of dead planks and sticks 75% of the time or charcoal and sticks 25% of the time.

Not only does it not replace the drop, it adds to the drops so it drops the dead log, dead plank and stick, or the dead log, charcoal and stick.
It also does this with any biomesoplenty block as far as I can tell.

Dropt version 1.12.2-1.6.5
Anthenaeum version 1.12.2-1.9.5
Forge 2617

The last harvest of a tool seems to not match rules it should

I have a rule defined to drop rocks from stone when broken with a crude pickaxe. On the final harvest of the tool's life, when the tool's durability reads 0/32, the block drops cobblestone instead of rocks.

A possible cause may be that the tool is breaking and by the time the harvest event is fired, the tool doesn't exist in the player's hand anymore, thus not matching the appropriate rule.

This needs to be reproduced in a minimal environment to ensure that it isn't a conflict with another mod.

Issue with removing drops from leaves

Hi,

I'm trying to replace some of the drops from leaves (saplings, etc.), but in every instance I still get the original drops along with my replacements.

Here's a simple example rule, attempting to make dirt and leaves drop ink sacs:

{
	"rules": [
		{
			"match": {
				"blocks": {
					"blocks": [
						"minecraft:dirt:*",
						"minecraft:leaves:*"
					]
				}
			},
			"replaceStrategy": "REPLACE_ALL",
			"drops": [
				{
					"item": {
						"items": [
							"minecraft:dye:0"
						]
					}
				}
			]
		}
	]
}

When I implement this rule, the dirt will always drop ink sacs and never dirt, but the leaves will still drop saplings and apples occasionally.

The issue is able to be replicated with modded leaves as well. Specifically, my main intent is to make the dead leaves under "biomesoplenty:leaves_1:1" (and :5, :9, :13) drop nothing. No matter what I try, they seem to always drop the dead saplings and persimmons. I tested with vanilla oak leaves to verify it wasn't a modded issue and still got oak saplings and apples regardless.

Create rules with ZenScript

Syntax example:

import mods.dropt.Dropt;

Dropt.addRule(Dropt.rule()
  .debug(true)

  .match(Dropt.matchBlocks()
    .type("WHITELIST")
    .blocks(["minecraft:dirt", "minecraft:gravel"])
  )

  .match(Dropt.matchDrops()
    .type("WHITELIST")
    .blocks(["minecraft:string", "minecraft:flint"])
  )

  .match(Dropt.matchHarvester()
    .type("PLAYER")
    .require("ANY")
    .stages(Dropt.matchGameStages()
      .type("WHITELIST")
      .require("ALL")
      .stages(["one", "two"])
    )
    .playerName(Dropt.matchPlayerName()
      .type("WHITELIST")
      .names(["player1", "player2"])
    )
  )

  .replaceStrategy("ENUM")

  .dropStrategy("ENUM")
  
  .dropCount(Dropt.randomFortuneInt()
    .fixed(1)
    .range(1, 2)
    .fortuneModifier(0)
  )

  .addDrop(Dropt.drop()
    .selector(Dropt.dropSelector()
      .weight(Dropt.dropSelectorWeight()
        .value(10)
        .fortuneModifier(10)
      )
      .silktouch("EXCLUDED")
      .fortuneLevelRequired(2)
    )
    .item(Dropt.dropItem()
      .items(["minecraft:string"])
      .quantity(Dropt.randomFortuneInt()
        .fixed(1)
        .range(1, 2)
        .fortuneModifier(0)
      )
    )
    .xp(Dropt.randomFortuneInt()
        .fixed(1)
        .range(1, 2)
        .fortuneModifier(0)
    )
  )
);

CTL No Crash Log

MC/F 1.12.2/2613

MC launches when Dropt/Athenaeum are removed. No further information available.

How to remove one specific item from the output from a block

Hello,
I try to change the ouput from an ore top remove one of the possible drop, and we can't find how to do, by looking the explications of the mod and examples.

more exactly, I try to remove the item "nuclearcraft:gem", from the redstone ores from Geolosys (The Cinnabar, id: "geolosys:ore_vanilla:1"). I know how to remove all drop and replace, but I think it will be easier to just blacklist an item to the output chance, but, I really not understand how to set the blacklist on the json file.

Can you give me an example how to do, and possibly adding to the examples list should be great ;).

I just give you one example, but we have a lot of drop to fix using that method...

Thank's
Fireztonez

Forestry's Apatite Ore / Evilcraft's Dark Ore continue to drop their experience

Given this JSON: https://hastebin.com/rocucewulu.json, I'm trying to make blocks silk touch drop their ores and for all of the ores listed except Forestry's Apatite (forestry:resources:0) and Evilcraft's Dark Ores, those still continue to drop experience. Any insight on this?

If nothing can be done on Dropt's end, what should I be recommending to the Evilcraft/Forestry devs to change about their ore blocks so it'll respect Dropt's changes?

Thanks again btw for your earlier changes with the XP replace strategy, it's been helping a lot with my planned ore processing so far.

Silk touch not working as expected with mod Geolosys

Hey there,
I've been having some trouble getting the silktouch rule to work with dropt, and was wondering if you could help. I'm trying to customize the drops for an ore block, where fortune 0-1 drops 1-2 items and fortune 2-3 drops 2-3 items. However, I also want this ore to drop a specific block when mined with silk touch. I attempt to accomplish this by having all of the non-silk methods have "silktouch": "EXCLUDED" while the silk method has "silktouch": "REQUIRED". In game however, only the "EXCLUDED" drops are selected, even when using a silk touch enchanted pickaxe. Am I doing something wrong with this file? Is the "silktouch" method busted?

Here is the drop file in question: https://pastebin.com/9t6a0mzL

Rule file priority is reversed

When I set a rule to have 1000 priority and another rule to have -1000 priority, the -1000 priority rule file is checked first.

I expect that the 1000 priority rule file would get checked first.

Blocks using Block#dropBlockAsItemWithChance()

I could be totally wrong, but it appears that blocks which manage their drops using Block#dropBlockAsitemWithChance() instead of getItemDropped() or another such method are not getting recognized by Dropt. If so, my question is whether it would be possible to fix this by adding a call to the function under EventHandler.onHarvestDropsEvent(), as HarvestDropsEvent does appear to expose all of the necessary information for doing so. If not, please let me know so I can make changes on my end.

Thank you so much!

Add rule caching to improve performance

When a rule is successfully matched, place it into Map<IBlockState, List<Rule>>. For each block harvest event, check this map first before iterating the rule set. When rules are reloaded, clear the map.

Suggestions

Heya :)

I've read the whole wiki/syntax and correct if I am wrong but could it be that it's not possible to use chances? What I understood from it was that you can use Weight, what will put the name into the pool by the weight amount and at the end pick 1(or how many drops you choose).
And that would mean that the block would have a 100% chance of dropping at least 1 thing, now I wanted to add stick dropped by ore:treeLeaves with a chance of 15% and came across that problem ^^'
I am a person who prefers using Chance instead of Weight especially for drops ^^'

My second suggestion would be the same as in artisan-worktable :)
a Skillable Level Condition Support :)

harvester type: explosive

Currently we got the harvester types player, non-player and any, I think it would be very cool if I could specify that explosives have to break a block to get a specific drop from it.
Would enable a lot of cool in world crafting options with explosives, creepers etc.

Dropt with leaves

I guess it is because of different blockstates (can decay = true/false):
When placing leaves in the world, the drops are the default ones, while breaking naturally generated leaves drops the configured drops. It took me a while to realize that.

Allow XP to drop without selecting a drop

I'm currently trying to make it so that ores that drop themselves (vanilla iron and gold, for example) also drop XP.

However, it is impossible to simply add experience drops to something. If the "item" field in IRuleDrop is omitted, or if it contains only drops with a fixed amount of 0, then the "xp" field will not even be parsed. In order to get the "xp" field to be parsed, the current syntax implementation forces you to drop at least one item.

As a result, you have to work with "replaceStrategy":"REPLACE_ALL", and write a rule that drops the block itself, even though it already does that without a rule present.

The reason to modify this behavior, and let the "xp" field be parsed even without parsing an item drop, is one of convenience. Right now, the modded instance I am tring to modify has 19 ores that drop themselves. Which means, I have to write 19 complete, individual drop replacement rules, each targeting only one single ore. If, instead, I could work with "replaceStrategy":"ADD" and an empty "item" field, I would need only two or three rules, each of which matches several different ores, based on grouping them by harvest level.

[Question] Making Blocks drop XP

How would one go about adding XP drops to blocks? I'm attempting to recreate Redstone, Diamond, Coal, Quartz and Emerald Ore.

Difficulty Requirement

Heya

How about being able to set a Difficulty as requirement(Easy, Normal, Hard) for a drop such as being able to multiply drops &/ xp with difficulty with a multiplier how much it should increase and with an option to decrease it.
e.g.
From Ore X: with Multiplier (Easy = 1, Normal = 1.5, Hard = 2.5) & negative
Easy:
30 XP --> 30 XP | 30 XP --> 30 XP
Normal:
30 XP --> 45 XP | 30 XP --> 20 XP
Hard:
30 XP --> 75 XP | 30 XP --> 12 XP
such as for Drops

Another thing I'd love to see is being able to add drops if reached a specific difficulty from ScalingHealth, e.g. when reached difficulty 100 add Quart drops to Netherrack etc. or, remove 1 Quartz drop from a Quartz Ore.

To not confuse you,
with the first difficulty system I meant Vanilla Difficulty System (Easy, Normal, Hard)
and with the second I meant Scaling Health Difficulty System ^^

Disable Randomness Factor?

Is there anyway to disable choosing of two items if two items are given? I just want them both to drop at once.

JEI Support

What about add JEI Support so that players can know how to get things without tips?

Add more examples

So, I want to have it where when mining with a certain item, certain things drop from a certain block.
Ergo, When mining COBBLESTONE with a WOODEN HAMMER drop the cobblestone and A DUST.

Your example got me started, I guess, but the wall of text that is syntax doesnt.
What does "IF SELECTED" mean?

Im sorry, but I just get dyslexic when it comes to walls of text, and Examples are the best use for me.

Meta is ignored in matching

Minecraft Version: 1.12.2
Forge Version: 2611
Mod Version: 1.6.5

The following rule causes all instances of "minecraft:stone" to drop "minecraft:stone:1":

{
	"match": {
		"blocks": {
			"blocks": ["minecraft:stone:2"]
		}
	},
	"replaceStrategy": REPLACE_ALL_IF_SELECTED,
	"drops": [
		{
			"selector": {
				"silktouch": EXCLUDED
			},
			"item": {
				"items": ["minecraft:stone:1"]
			}
		}
	]
}

How to Prevent XP / Resonating Redstone Crystals from Dropping from Redstone

Hi CT,

I'm using the following JSON to try and replace all redstone ores drops as if they drop like silk touch. However this continues to result in experience dropping, and other drops such as XU2's Resonating Redstone Crystal. I recently moved to your system from Block Drops Tweaker (which somehow prevented the drops, but not exactly sure what I did ther).

The documentation on the wiki says that it should replace all of the drops and by default give 0 xp if I left it blank, any idea what I'm doing wrong?

Blacklisted harvest level doesn't work as expected

When blacklisting a harvest level, say shovel;1;-1, I expect that only shovels of harvest level equal to or greater than 1 will prevent the match.

However, the blacklist logic tests each separately and first tests if the item is a shovel. If it is, the rule match immediately fails and the harvest level range isn't checked.

I would expect the match to fail if the held item is a shovel AND within the range specified.

Example inconsistency

Ok, I need the better with mods's unfired brick to drop itself, so I created this script

{
  "rules": [
    {
      "match": {
        "drops": {
          "items": [
            "betterwithmods:unfired_pottery:4"
          ]
        }
      },
      "replaceStrategy": "REPLACE_ITEMS_IF_SELECTED",
      "drops": [
        {
          "selector": {
            "weight": {
              "value": 100
            }
          },
          "item": {
            "items": [
              "betterwithmods:unfired_pottery:4"
            ]
          }
        }
      ]
    }
  ]
}

but instead of adding the drop just to the brick it adds it to every item in the game
I don't know what replace strategies are avaliable, but I think the problem is there

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.