Forge 31.2.0 fixes (#1605)

* Changed environment for testing in eclipse

* Fixes issue for Forge 31.2.0

Changes the way SoundEvents are constructed as to no longer use depreciated call to super in 31.2.0

* Remove generated files

Some things got past BiomeOPlenty's .gitignore, simply removing them before submitting a PR

* Cleanup

Should resolve style issues in PR

Co-authored-by: D Melton <55304913+DMelton1221@users.noreply.github.com>
This commit is contained in:
AtlaStar 2020-05-16 01:15:44 -07:00 committed by GitHub
parent 4919a112be
commit 3321b05f22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 6 deletions

View file

@ -7,7 +7,7 @@ mod_version=10.0.0
minecraft_version=1.15.2 minecraft_version=1.15.2
minecraft_version_toml=15 minecraft_version_toml=15
forge_version=31.1.88 forge_version=31.2.0
forge_version_toml=31 forge_version_toml=31
forge_group=net.minecraftforge forge_group=net.minecraftforge
mappings_version=0-1.15.2 mappings_version=0-1.15.2

View file

@ -11,5 +11,5 @@ import net.minecraft.util.SoundEvent;
public class BOPSounds public class BOPSounds
{ {
public static SoundEvent music_disc_wanderer; public static SoundEvent music_disc_wanderer;
} }

View file

@ -8,15 +8,27 @@
package biomesoplenty.common.item; package biomesoplenty.common.item;
import biomesoplenty.common.util.inventory.ItemGroupBOP; import biomesoplenty.common.util.inventory.ItemGroupBOP;
import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.MusicDiscItem; import net.minecraft.item.MusicDiscItem;
import net.minecraft.item.Rarity; import net.minecraft.item.Rarity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.ForgeRegistries;
public class MusicDiscItemBOP extends MusicDiscItem public class MusicDiscItemBOP extends MusicDiscItem
{ {
public MusicDiscItemBOP(SoundEvent record) //Provide a resource location and the correct registry to retrieve a SoundEvent supplier
public static RegistryObject<SoundEvent> soundProvider(String soundName) {
return RegistryObject.of(
new ResourceLocation(BiomesOPlenty.MOD_ID, soundName),
ForgeRegistries.SOUND_EVENTS
);
};
public MusicDiscItemBOP(String record)
{ {
super(0, record, new Item.Properties().tab(ItemGroupBOP.instance).rarity(Rarity.RARE).stacksTo(1)); super(0, soundProvider(record), new Item.Properties().tab(ItemGroupBOP.instance).rarity(Rarity.RARE).stacksTo(1));
} }
} }

View file

@ -7,7 +7,6 @@
******************************************************************************/ ******************************************************************************/
package biomesoplenty.init; package biomesoplenty.init;
import biomesoplenty.api.sound.BOPSounds;
import biomesoplenty.common.entity.item.BoatEntityBOP; import biomesoplenty.common.entity.item.BoatEntityBOP;
import biomesoplenty.common.item.BoatItemBOP; import biomesoplenty.common.item.BoatItemBOP;
import biomesoplenty.common.item.MusicDiscItemBOP; import biomesoplenty.common.item.MusicDiscItemBOP;
@ -29,7 +28,7 @@ public class ModItems
mud_ball = registerItem(new Item(new Item.Properties().tab(ItemGroupBOP.instance)), "mud_ball"); mud_ball = registerItem(new Item(new Item.Properties().tab(ItemGroupBOP.instance)), "mud_ball");
mud_brick = registerItem(new Item(new Item.Properties().tab(ItemGroupBOP.instance)), "mud_brick"); mud_brick = registerItem(new Item(new Item.Properties().tab(ItemGroupBOP.instance)), "mud_brick");
music_disc_wanderer = registerItem(new MusicDiscItemBOP(BOPSounds.music_disc_wanderer), "music_disc_wanderer"); music_disc_wanderer = registerItem(new MusicDiscItemBOP("music_disc.wanderer"), "music_disc_wanderer");
fir_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.FIR, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "fir_boat"); fir_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.FIR, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "fir_boat");
redwood_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.REDWOOD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "redwood_boat"); redwood_boat = registerItem(new BoatItemBOP(BoatEntityBOP.Type.REDWOOD, (new Item.Properties()).stacksTo(1).tab(ItemGroupBOP.instance)), "redwood_boat");

View file

@ -17,6 +17,7 @@ import net.minecraftforge.registries.ForgeRegistries;
import static biomesoplenty.api.sound.BOPSounds.music_disc_wanderer; import static biomesoplenty.api.sound.BOPSounds.music_disc_wanderer;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModSounds public class ModSounds
{ {