Compare commits

...

2 commits

Author SHA1 Message Date
4e9d0f1d06 Merge upstream 2022-11-13 16:48:52 +01:00
2d1a2f14e5 Add ore indicators as items placed on the ground
Item placing on the ground is added by Draconic Evolution,
I used a janky way to setblock generated indicator to that tile.
That tile needs nbt so I had to set a block using execute as setblock command,
which is bad, because it spams logs and operators chat
2022-11-13 07:54:48 +01:00
5 changed files with 100 additions and 4 deletions

View file

@ -5,6 +5,12 @@
"block": "ic2:resource", "block": "ic2:resource",
"meta": 1 "meta": 1
}, },
"indicator": {
"blocks": "contenttweaker:juice/internal/indicator/copper",
"ignore_vegatation": false,
"ignore_liquids": false,
"rarity": 24
},
"stone": "minecraft:stone", "stone": "minecraft:stone",
"rarity": 160, "rarity": 160,
"min_y": -30, "min_y": -30,
@ -21,6 +27,12 @@
"block": "forestry:resources", "block": "forestry:resources",
"meta": 0 "meta": 0
}, },
"indicator": {
"blocks": "contenttweaker:juice/internal/indicator/apatite",
"ignore_vegatation": false,
"ignore_liquids": false,
"rarity": 24
},
"stone": "minecraft:stone", "stone": "minecraft:stone",
"rarity": "100", "rarity": "100",
"min_y": -10, "min_y": -10,
@ -36,9 +48,9 @@
"ore": "minecraft:gold_ore", "ore": "minecraft:gold_ore",
"stone": "minecraft:stone", "stone": "minecraft:stone",
"indicator": { "indicator": {
"blocks": "minecraft:gold_ore", "blocks": "contenttweaker:juice/internal/indicator/gold",
"ignore_vegatation": false, "ignore_vegatation": false,
"ignore_liquids": true, "ignore_liquids": false,
"rarity": 24 "rarity": 24
}, },
"rarity": 200, "rarity": 200,

10
index.toml generated
View file

@ -1146,7 +1146,7 @@ hash = "5046cde3673ccd62ba2209aaab9a917b3e1b0da7f521477e89f68bdba1648187"
[[files]] [[files]]
file = "config/oreveins/ore_veins.json" file = "config/oreveins/ore_veins.json"
hash = "902bbc0437f614c8251a280a9960e4d6d52b7fad0f155bafaf838dcacbb2eb72" hash = "7067d0416027c37e15664292adee87595e6854ef706191138d4e833f40d7ee69"
[[files]] [[files]]
file = "config/sereneseasons/biome_info.json" file = "config/sereneseasons/biome_info.json"
@ -2393,3 +2393,11 @@ hash = "b4aea7892748ecfa5cf775fb0a18f0909795c0b025666ecaea88bb3a923b4194"
[[files]] [[files]]
file = "scripts/nc_script_addons/MoarRealisticRadiation/rad_qmd.zs" file = "scripts/nc_script_addons/MoarRealisticRadiation/rad_qmd.zs"
hash = "a07879875ad20ae8e285c3cb39beeee648bd080ec12985b76583ad707a3de3ee" hash = "a07879875ad20ae8e285c3cb39beeee648bd080ec12985b76583ad707a3de3ee"
[[files]]
file = "scripts/ore_veins/indicators.1.zs"
hash = "eee1737869c3a9a2d2261894b32f09d8dee48df55f07393eec54ba8748a13d79"
[[files]]
file = "scripts/ore_veins/indicators.2.zs"
hash = "08d456f730c1a797aab31811ba5a24e319ce35d000c4af80348a964a6c471898"

View file

@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index] [index]
file = "index.toml" file = "index.toml"
hash-format = "sha256" hash-format = "sha256"
hash = "e87241e8996c4ec0f34c2bf0ab46d0b994a591af4592c2106b98b5886a26be5d" hash = "527f56bf2ae60d1bb9da7e557bcc334b28b86463a098678d67220e81479a5bf9"
[versions] [versions]
forge = "14.23.5.2860" forge = "14.23.5.2860"

View file

@ -0,0 +1,71 @@
#loader contenttweaker
import mods.contenttweaker.Block;
import mods.contenttweaker.DropHandler;
import mods.contenttweaker.ResourceLocation;
import mods.contenttweaker.VanillaFactory;
var nugget_table as string[][] = [
# [name, id, meta]
["copper", "thermalfoundation:ore", "0"],
["apatite", "forestry:resources", "0"],
["gold", "minecraft:gold_ore", "0"]
];
function replaceCommand(blockName as string, item as string, meta as string, blockPos as mods.contenttweaker.BlockPos) as string {
return "execute @a " +
blockPos.getX() as string + " " +
blockPos.getY() as string + " " +
blockPos.getZ() as string + " " +
"detect " +
blockPos.getX() as string + " " +
blockPos.getY() as string + " " +
blockPos.getZ() as string + " " +
"contenttweaker:" + blockName + " * " +
"setblock " +
blockPos.getX() as string + " " +
blockPos.getY() as string + " " +
blockPos.getZ() as string + " " +
"draconicevolution:placed_item " +
"0 " +
"replace " +
"{InventoryStacks: [{ id: \"" + item + "\", Count: 1, Damage: " + meta as string + " }]}";
}
for i in nugget_table {
var blockName as string = "juice/internal/indicator/" + i[0];
var item as string = i[1];
var meta as string = i[2];
print("Adding internal ore indicator block: " + i[0]);
var block = VanillaFactory.createBlock(blockName, <blockmaterial:air>);
block.setTextureLocation(ResourceLocation.create("contenttweaker:blocks/ore_nugget"));
block.setToolLevel(0);
# block.setAxisAlignedBB(mods.contenttweaker.AxisAlignedBB.create(0.375f, 0.0f, 0.375f, 0.625f, 0.125f, 0.625f));
block.setEnumBlockRenderType("MODEL");
block.setBlockHardness(0.1);
block.setBlockLayer("CUTOUT");
block.setBlockResistance(0);
block.setDropHandler(function(drops, world, position, state, fortune) { drops.clear(); });
block.setFullBlock(false);
block.setLightOpacity(0);
block.setPassable(true);
block.setReplaceable(true);
# janky hack, mate
block.setOnBlockPlace(function(world, blockPos, blockState) {
var command as string = replaceCommand(blockName, item, meta, blockPos);
server.commandManager.executeCommand(server, command);
});
block.setOnRandomTick(function(world, blockPos, blockState) {
var command as string = replaceCommand(blockName, item, meta, blockPos);
server.commandManager.executeCommand(server, command);
});
block.setOnUpdateTick(function(world, blockPos, blockState) {
var command as string = replaceCommand(blockName, item, meta, blockPos);
server.commandManager.executeCommand(server, command);
});
block.register();
}

View file

@ -0,0 +1,5 @@
for i in loadedMods["contenttweaker"].items {
if (i.definition.name.contains("internal")) {
mods.jei.JEI.hide(i);
}
}