mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
1 parent
5e64ef9ecb
commit
4bfe562f14
6 files changed
+102
-28
No files matched your search
@@ -53,18 +53,6 @@ function initializeCoreMod() {
|
||||
return classNode;
|
||||
}
|
||||
},
|
||||
/*
|
||||
'mob_bucket_item': {
|
||||
'target': {
|
||||
'type': 'CLASS',
|
||||
'name': 'net.minecraft.world.item.MobBucketItem'
|
||||
},
|
||||
'transformer': function(classNode) {
|
||||
ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_41262_'), ASMAPI.mapMethod('getFishType')) // type - Not implemented
|
||||
return classNode;
|
||||
}
|
||||
},
|
||||
*/
|
||||
'itemstack': {
|
||||
'target': {
|
||||
'type': 'CLASS',
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.debug.item;
|
||||
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.MobBucketItem;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
@Mod(CustomMobBucketTest.MODID)
|
||||
public class CustomMobBucketTest
|
||||
{
|
||||
public static final String MODID = "custom_mob_bucket_test";
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||
|
||||
public static final boolean ENABLED = true;
|
||||
|
||||
public static final RegistryObject<Item> COW_BUCKET = ITEMS.register("cow_bucket", () -> new MobBucketItem(
|
||||
() -> EntityType.COW,
|
||||
() -> Fluids.WATER,
|
||||
() -> SoundEvents.BUCKET_EMPTY_FISH,
|
||||
(new Item.Properties()).stacksTo(1).tab(CreativeModeTab.TAB_MISC)));
|
||||
|
||||
public CustomMobBucketTest()
|
||||
{
|
||||
if (ENABLED)
|
||||
{
|
||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
ITEMS.register(modEventBus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,8 @@ license="LGPL v2.1"
|
||||
modId="part_entity_test"
|
||||
[[mods]]
|
||||
modId="capabilities_test"
|
||||
[[mods]]
|
||||
modId="custom_mob_bucket_test"
|
||||
[[mods]]
|
||||
modId="custom_armor_model_test"
|
||||
[[mods]]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "custom_mob_bucket_test:item/cow_bucket"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Reference in new issue
Block a user