Organize mods into modpacks for better overview
1
mods/ITEMS/mcl_boats/depends.txt
Normal file
|
@ -0,0 +1 @@
|
|||
mcl_core
|
184
mods/ITEMS/mcl_boats/init.lua
Normal file
|
@ -0,0 +1,184 @@
|
|||
--
|
||||
-- Helper functions
|
||||
--
|
||||
local init = os.clock()
|
||||
|
||||
local function is_water(pos)
|
||||
local nn = minetest.get_node(pos).name
|
||||
return minetest.get_item_group(nn, "water") ~= 0
|
||||
end
|
||||
|
||||
local function get_velocity(v, yaw, y)
|
||||
local x = -math.sin(yaw)*v
|
||||
local z = math.cos(yaw)*v
|
||||
return {x=x, y=y, z=z}
|
||||
end
|
||||
|
||||
--
|
||||
-- boat entity
|
||||
--
|
||||
local boat = {
|
||||
physical = true,
|
||||
collisionbox = {-1,-0.5,-1, 1,0.5,1},
|
||||
visual = "mesh",
|
||||
mesh = "mcl_boats_base.x",
|
||||
|
||||
_driver = nil,
|
||||
_v = 0,
|
||||
_stepcount = 0,
|
||||
_unattended = 0
|
||||
}
|
||||
|
||||
function boat.on_rightclick(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
if self._driver and clicker == self._driver then
|
||||
self._driver = nil
|
||||
clicker:set_detach()
|
||||
elseif not self._driver then
|
||||
self._driver = clicker
|
||||
clicker:set_attach(self.object, "", {x=0,y=5,z=0}, {x=0,y=0,z=0})
|
||||
self.object:setyaw(clicker:get_look_yaw())
|
||||
end
|
||||
end
|
||||
|
||||
function boat.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
if staticdata then
|
||||
self._v = tonumber(staticdata)
|
||||
end
|
||||
end
|
||||
|
||||
function boat.get_staticdata()
|
||||
return tostring(v)
|
||||
end
|
||||
|
||||
function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction)
|
||||
|
||||
if self._driver then
|
||||
self._driver:set_detach()
|
||||
self._driver = nil
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
puncher:get_inventory():add_item("main", "mcl_boats:boat")
|
||||
end
|
||||
self.object:remove()
|
||||
else
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
puncher:get_inventory():add_item("main", "mcl_boats:boat")
|
||||
end
|
||||
self.object:remove()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function boat.on_step(self, dtime)
|
||||
|
||||
self._stepcount=self._stepcount+1
|
||||
if self._stepcount>9 then
|
||||
|
||||
self._stepcount=0
|
||||
|
||||
if self._driver then
|
||||
local ctrl = self._driver:get_player_control()
|
||||
|
||||
self._unattended=0
|
||||
|
||||
local yaw = self.object:getyaw()
|
||||
|
||||
if ctrl.up and self._v<3 then
|
||||
self._v = self._v + 1
|
||||
end
|
||||
|
||||
if ctrl.down and self._v>=-1 then
|
||||
self._v = self._v - 1
|
||||
end
|
||||
|
||||
if ctrl.left then
|
||||
if ctrl.down then
|
||||
self.object:setyaw(yaw-math.pi/12-dtime*math.pi/12)
|
||||
else
|
||||
self.object:setyaw(yaw+math.pi/12+dtime*math.pi/12)
|
||||
end
|
||||
end
|
||||
if ctrl.right then
|
||||
if ctrl.down then
|
||||
self.object:setyaw(yaw+math.pi/12+dtime*math.pi/12)
|
||||
else
|
||||
self.object:setyaw(yaw-math.pi/12-dtime*math.pi/12)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local tmp_velocity = get_velocity(self._v, self.object:getyaw(), 0)
|
||||
|
||||
local tmp_pos = self.object:getpos()
|
||||
|
||||
tmp_velocity.y=0
|
||||
|
||||
if is_water(tmp_pos) then
|
||||
tmp_velocity.y=2
|
||||
end
|
||||
|
||||
tmp_pos.y=tmp_pos.y-0.5
|
||||
|
||||
if minetest.get_node(tmp_pos).name=="air" then
|
||||
tmp_velocity.y=-2
|
||||
end
|
||||
|
||||
self.object:setvelocity(tmp_velocity)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local woods = { "", "_spruce", "_birch", "_jungle", "_dark", "_acacia" }
|
||||
local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Dark Oak Boat", "Acacia Boat" }
|
||||
local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:darkwood", "mcl_core:acaciawood" }
|
||||
local images = { "oak", "spruce", "birch", "jungle", "dark_oak", "acacia" }
|
||||
|
||||
for w=1, #woods do
|
||||
local textures = {"mcl_boats_texture.png"}
|
||||
minetest.register_entity("mcl_boats:boat"..woods[w], boat)
|
||||
|
||||
minetest.register_craftitem("mcl_boats:boat"..woods[w], {
|
||||
description = names[w],
|
||||
inventory_image = "mcl_boats_"..images[w].."_boat.png",
|
||||
liquids_pointable = true,
|
||||
groups = { boat = 1, transport = 1},
|
||||
stack_max = 1,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
if not is_water(pointed_thing.under) then
|
||||
return
|
||||
end
|
||||
pointed_thing.under.y = pointed_thing.under.y+0.5
|
||||
minetest.add_entity(pointed_thing.under, "mcl_boats:boat"..woods[w])
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
local c = craftstuffs[w]
|
||||
minetest.register_craft({
|
||||
output = "mcl_boats:boat"..woods[w],
|
||||
recipe = {
|
||||
{c, "", c},
|
||||
{c, c, c},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:boat",
|
||||
burntime = 20,
|
||||
})
|
||||
|
||||
local time_to_load= os.clock() - init
|
||||
print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load))
|
1
mods/ITEMS/mcl_boats/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mcl_boats
|
403
mods/ITEMS/mcl_boats/models/mcl_boats_base.x
Normal file
|
@ -0,0 +1,403 @@
|
|||
xof 0302txt 0064
|
||||
// File created by CINEMA 4D
|
||||
|
||||
template Header {
|
||||
<3D82AB43-62DA-11cf-AB39-0020AF71E433>
|
||||
SWORD major;
|
||||
SWORD minor;
|
||||
DWORD flags;
|
||||
}
|
||||
|
||||
template Vector {
|
||||
<3D82AB5E-62DA-11cf-AB39-0020AF71E433>
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
FLOAT z;
|
||||
}
|
||||
|
||||
template Coords2d {
|
||||
<F6F23F44-7686-11cf-8F52-0040333594A3>
|
||||
FLOAT u;
|
||||
FLOAT v;
|
||||
}
|
||||
|
||||
template Matrix4x4 {
|
||||
<F6F23F45-7686-11cf-8F52-0040333594A3>
|
||||
array FLOAT matrix[16];
|
||||
}
|
||||
|
||||
template ColorRGBA {
|
||||
<35FF44E0-6C7C-11cf-8F52-0040333594A3>
|
||||
FLOAT red;
|
||||
FLOAT green;
|
||||
FLOAT blue;
|
||||
FLOAT alpha;
|
||||
}
|
||||
|
||||
template ColorRGB {
|
||||
<D3E16E81-7835-11cf-8F52-0040333594A3>
|
||||
FLOAT red;
|
||||
FLOAT green;
|
||||
FLOAT blue;
|
||||
}
|
||||
|
||||
template IndexedColor {
|
||||
<1630B820-7842-11cf-8F52-0040333594A3>
|
||||
DWORD index;
|
||||
ColorRGBA indexColor;
|
||||
}
|
||||
|
||||
template Boolean {
|
||||
<4885AE61-78E8-11cf-8F52-0040333594A3>
|
||||
SWORD truefalse;
|
||||
}
|
||||
|
||||
template Boolean2d {
|
||||
<4885AE63-78E8-11cf-8F52-0040333594A3>
|
||||
Boolean u;
|
||||
Boolean v;
|
||||
}
|
||||
|
||||
template MaterialWrap {
|
||||
<4885AE60-78E8-11cf-8F52-0040333594A3>
|
||||
Boolean u;
|
||||
Boolean v;
|
||||
}
|
||||
|
||||
template TextureFilename {
|
||||
<A42790E1-7810-11cf-8F52-0040333594A3>
|
||||
STRING filename;
|
||||
}
|
||||
|
||||
template Material {
|
||||
<3D82AB4D-62DA-11cf-AB39-0020AF71E433>
|
||||
ColorRGBA faceColor;
|
||||
FLOAT power;
|
||||
ColorRGB specularColor;
|
||||
ColorRGB emissiveColor;
|
||||
[...]
|
||||
}
|
||||
|
||||
template MeshFace {
|
||||
<3D82AB5F-62DA-11cf-AB39-0020AF71E433>
|
||||
DWORD nFaceVertexIndices;
|
||||
array DWORD faceVertexIndices[nFaceVertexIndices];
|
||||
}
|
||||
|
||||
template MeshFaceWraps {
|
||||
<4885AE62-78E8-11cf-8F52-0040333594A3>
|
||||
DWORD nFaceWrapValues;
|
||||
Boolean2d faceWrapValues;
|
||||
}
|
||||
|
||||
template MeshTextureCoords {
|
||||
<F6F23F40-7686-11cf-8F52-0040333594A3>
|
||||
DWORD nTextureCoords;
|
||||
array Coords2d textureCoords[nTextureCoords];
|
||||
}
|
||||
|
||||
template MeshMaterialList {
|
||||
<F6F23F42-7686-11cf-8F52-0040333594A3>
|
||||
DWORD nMaterials;
|
||||
DWORD nFaceIndexes;
|
||||
array DWORD faceIndexes[nFaceIndexes];
|
||||
[Material]
|
||||
}
|
||||
|
||||
template MeshNormals {
|
||||
<F6F23F43-7686-11cf-8F52-0040333594A3>
|
||||
DWORD nNormals;
|
||||
array Vector normals[nNormals];
|
||||
DWORD nFaceNormals;
|
||||
array MeshFace faceNormals[nFaceNormals];
|
||||
}
|
||||
|
||||
template MeshVertexColors {
|
||||
<1630B821-7842-11cf-8F52-0040333594A3>
|
||||
DWORD nVertexColors;
|
||||
array IndexedColor vertexColors[nVertexColors];
|
||||
}
|
||||
|
||||
template Mesh {
|
||||
<3D82AB44-62DA-11cf-AB39-0020AF71E433>
|
||||
DWORD nVertices;
|
||||
array Vector vertices[nVertices];
|
||||
DWORD nFaces;
|
||||
array MeshFace faces[nFaces];
|
||||
[...]
|
||||
}
|
||||
|
||||
template FrameTransformMatrix {
|
||||
<F6F23F41-7686-11cf-8F52-0040333594A3>
|
||||
Matrix4x4 frameMatrix;
|
||||
}
|
||||
|
||||
template Frame {
|
||||
<3D82AB46-62DA-11cf-AB39-0020AF71E433>
|
||||
[...]
|
||||
}
|
||||
|
||||
Header {
|
||||
1;
|
||||
0;
|
||||
1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Mesh CINEMA4D_Mesh {
|
||||
40;
|
||||
// Boat
|
||||
-4.57;1.138;5.672;,
|
||||
-4.57;4.55;5.672;,
|
||||
-5.707;1.138;5.668;,
|
||||
-5.707;4.55;5.668;,
|
||||
-5.668;1.138;-5.707;,
|
||||
-5.668;4.55;-5.707;,
|
||||
-4.53;1.138;-5.703;,
|
||||
-4.53;4.55;-5.703;,
|
||||
4.57;1.138;-5.672;,
|
||||
4.57;4.55;-5.672;,
|
||||
5.707;1.138;-5.668;,
|
||||
5.707;4.55;-5.668;,
|
||||
5.668;1.138;5.707;,
|
||||
5.668;4.55;5.707;,
|
||||
4.53;1.138;5.703;,
|
||||
4.53;4.55;5.703;,
|
||||
5.668;1.138;5.707;,
|
||||
5.668;4.55;5.707;,
|
||||
5.664;1.138;6.845;,
|
||||
5.664;4.55;6.845;,
|
||||
-5.711;1.138;6.805;,
|
||||
-5.711;4.55;6.805;,
|
||||
-5.707;1.138;5.668;,
|
||||
-5.707;4.55;5.668;,
|
||||
-5.668;1.138;-5.707;,
|
||||
-5.668;4.55;-5.707;,
|
||||
-5.664;1.138;-6.845;,
|
||||
-5.664;4.55;-6.845;,
|
||||
5.711;1.138;-6.805;,
|
||||
5.711;4.55;-6.805;,
|
||||
5.707;1.138;-5.668;,
|
||||
5.707;4.55;-5.668;,
|
||||
-4.574;-1.138;6.809;,
|
||||
-4.574;1.138;6.809;,
|
||||
-4.526;-1.138;-6.841;,
|
||||
-4.526;1.138;-6.841;,
|
||||
4.574;-1.138;-6.809;,
|
||||
4.574;1.138;-6.809;,
|
||||
4.526;-1.138;6.841;,
|
||||
4.526;1.138;6.841;;
|
||||
|
||||
30;
|
||||
// Boat
|
||||
4;0,1,3,2;,
|
||||
4;2,3,5,4;,
|
||||
4;4,5,7,6;,
|
||||
4;6,7,1,0;,
|
||||
4;1,7,5,3;,
|
||||
4;6,0,2,4;,
|
||||
4;8,9,11,10;,
|
||||
4;10,11,13,12;,
|
||||
4;12,13,15,14;,
|
||||
4;14,15,9,8;,
|
||||
4;9,15,13,11;,
|
||||
4;14,8,10,12;,
|
||||
4;16,17,19,18;,
|
||||
4;18,19,21,20;,
|
||||
4;20,21,23,22;,
|
||||
4;22,23,17,16;,
|
||||
4;17,23,21,19;,
|
||||
4;22,16,18,20;,
|
||||
4;24,25,27,26;,
|
||||
4;26,27,29,28;,
|
||||
4;28,29,31,30;,
|
||||
4;30,31,25,24;,
|
||||
4;25,31,29,27;,
|
||||
4;30,24,26,28;,
|
||||
4;32,33,35,34;,
|
||||
4;34,35,37,36;,
|
||||
4;36,37,39,38;,
|
||||
4;38,39,33,32;,
|
||||
4;33,39,37,35;,
|
||||
4;38,32,34,36;;
|
||||
|
||||
MeshNormals {
|
||||
40;
|
||||
// Boat
|
||||
0.035;-0.108;0.361;,
|
||||
0.035;0.108;0.361;,
|
||||
-0.037;-0.108;0.361;,
|
||||
-0.037;0.108;0.361;,
|
||||
-0.035;-0.108;-0.361;,
|
||||
-0.035;0.108;-0.361;,
|
||||
0.037;-0.108;-0.361;,
|
||||
0.037;0.108;-0.361;,
|
||||
-0.035;-0.108;-0.361;,
|
||||
-0.035;0.108;-0.361;,
|
||||
0.037;-0.108;-0.361;,
|
||||
0.037;0.108;-0.361;,
|
||||
0.035;-0.108;0.361;,
|
||||
0.035;0.108;0.361;,
|
||||
-0.037;-0.108;0.361;,
|
||||
-0.037;0.108;0.361;,
|
||||
0.003;-0.002;-0.625;,
|
||||
0.003;0.002;-0.625;,
|
||||
-0.002;-0.002;0.625;,
|
||||
-0.002;0.002;0.625;,
|
||||
-0.003;-0.002;0.625;,
|
||||
-0.003;0.002;0.625;,
|
||||
0.002;-0.002;-0.625;,
|
||||
0.002;0.002;-0.625;,
|
||||
-0.003;-0.002;0.625;,
|
||||
-0.003;0.002;0.625;,
|
||||
0.002;-0.002;-0.625;,
|
||||
0.002;0.002;-0.625;,
|
||||
0.003;-0.002;-0.625;,
|
||||
0.003;0.002;-0.625;,
|
||||
-0.002;-0.002;0.625;,
|
||||
-0.002;0.002;0.625;,
|
||||
-0.011;-0.028;0.611;,
|
||||
-0.011;0.028;0.611;,
|
||||
-0.007;-0.028;-0.611;,
|
||||
-0.007;0.028;-0.611;,
|
||||
0.011;-0.028;-0.611;,
|
||||
0.011;0.028;-0.611;,
|
||||
0.007;-0.028;0.611;,
|
||||
0.007;0.028;0.611;;
|
||||
|
||||
30;
|
||||
// Boat
|
||||
4;0,1,3,2;,
|
||||
4;2,3,5,4;,
|
||||
4;4,5,7,6;,
|
||||
4;6,7,1,0;,
|
||||
4;1,7,5,3;,
|
||||
4;6,0,2,4;,
|
||||
4;8,9,11,10;,
|
||||
4;10,11,13,12;,
|
||||
4;12,13,15,14;,
|
||||
4;14,15,9,8;,
|
||||
4;9,15,13,11;,
|
||||
4;14,8,10,12;,
|
||||
4;16,17,19,18;,
|
||||
4;18,19,21,20;,
|
||||
4;20,21,23,22;,
|
||||
4;22,23,17,16;,
|
||||
4;17,23,21,19;,
|
||||
4;22,16,18,20;,
|
||||
4;24,25,27,26;,
|
||||
4;26,27,29,28;,
|
||||
4;28,29,31,30;,
|
||||
4;30,31,25,24;,
|
||||
4;25,31,29,27;,
|
||||
4;30,24,26,28;,
|
||||
4;32,33,35,34;,
|
||||
4;34,35,37,36;,
|
||||
4;36,37,39,38;,
|
||||
4;38,39,33,32;,
|
||||
4;33,39,37,35;,
|
||||
4;38,32,34,36;;
|
||||
|
||||
}
|
||||
MeshTextureCoords {
|
||||
40;
|
||||
// Boat
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.062;,
|
||||
0.688;0.062;,
|
||||
0.688;0.062;,
|
||||
0.375;0.062;,
|
||||
0.688;0.25;,
|
||||
0.375;0.25;,
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.062;,
|
||||
0.688;0.062;,
|
||||
0.688;0.062;,
|
||||
0.375;0.062;,
|
||||
0.688;0.25;,
|
||||
0.375;0.25;,
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.062;,
|
||||
0.688;0.062;,
|
||||
0.688;0.062;,
|
||||
0.375;0.062;,
|
||||
0.688;0.25;,
|
||||
0.375;0.25;,
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.062;,
|
||||
0.688;0.062;,
|
||||
0.688;0.062;,
|
||||
0.375;0.062;,
|
||||
0.688;0.25;,
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.25;,
|
||||
0.375;0.25;,
|
||||
0.688;0.25;,
|
||||
0.375;0.062;,
|
||||
0.688;0.062;,
|
||||
0.688;0.062;,
|
||||
0.375;0.062;;
|
||||
}
|
||||
MeshMaterialList {
|
||||
3;
|
||||
30;
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1;
|
||||
|
||||
Material C4DMAT_NONE {
|
||||
1.0;1.0;1.0;1.0;;
|
||||
1.0;
|
||||
0.0;0.0;0.0;;
|
||||
0.0;0.0;0.0;;
|
||||
}
|
||||
Material C4DMAT_boat_png {
|
||||
1.0;1.0;1.0;1.0;;
|
||||
1.0;
|
||||
0.0;0.0;0.0;;
|
||||
0.0;0.0;0.0;;
|
||||
}
|
||||
|
||||
Material C4DMAT_Mat_riau_Ciel {
|
||||
1.0;1.0;1.0;1.0;;
|
||||
1.0;
|
||||
0.2;0.2;0.2;;
|
||||
0.0;0.0;0.0;;
|
||||
}
|
||||
|
||||
{C4DMAT_boat_png}
|
||||
}
|
||||
}
|
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_acacia_boat.png
Normal file
After Width: | Height: | Size: 844 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_birch_boat.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_dark_oak_boat.png
Normal file
After Width: | Height: | Size: 839 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_jungle_boat.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_oak_boat.png
Normal file
After Width: | Height: | Size: 849 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_spruce_boat.png
Normal file
After Width: | Height: | Size: 840 B |
BIN
mods/ITEMS/mcl_boats/textures/mcl_boats_texture.png
Normal file
After Width: | Height: | Size: 1.3 KiB |